Install
With npm
npm install --save-dev karma-fuse-box
With yarn
yarn add --dev karma-fuse-box
Usage
karma.conf.js
const path = ; module { config;};
Alternative Usage
This configuration is more performant, but you cannot run single test anymore (only the complete suite).
The above configuration generates a FuseBox
bundle for each test. For many test cases this can result in many big files.
The alternative configuration creates a single bundle with all test cases.
karma.conf.js
files: // only specify one entry point // and require all tests in there 'test/index_test.js' preprocessors: // add fusebox as preprocessor 'test/index_test.js': 'fusebox' // additional arithmetic instructions needed// unlike WebPack FuseBox will not recognize files only by source codefuseboxInstructions: '+ test/**_test.js'
test/index_test.js
// use fusebox runtime API to load spec filesFuseBox;
Options
Full list of options you can specify in your karma.conf.js
fusebox
FuseBox
configuration (fuse.js
)
fuseboxInstructions
String with additional instructions for file bundling