enb-bem-node-specs
Automatic spec tests for node.js BEM-blocks with ENB.
The test are described similar to enb-bem-specs.
Tests are written in mocha style with chai framework included.
Chai's expect
and assert
are also available on global scope.
Example test looks like this:
modules;
Usage
First, install npm module:
npm install --save enb-bem-node-specs
Then, to add enb-bem-node-specs
to your ENB project do something like this in .enb/make.js
:
...module { ... config; // 'specs' is the enb task name, you may change it if you like var nodeSpecConfig = config; ;}
To run specs, execute task specs
(or whichever task name you configured in make.js
):
node_modules/.bin/enb make specs
Coverage
enb-bem-node-specs
supports code coverage measure with istanbul
To enable it, add coverageFile
option in make.js
:
...module { ... config; // 'specs' is the enb task name, you may change it if you like var nodeSpecConfig = config; ;}
Coverage info will be merged into provided file, which helps to use enb-bem-node-specs
with other tasks (enb-bem-specs, for example, also uses coverage.json
)