vbuild-karma v1.0.1
vbuild-karma
Install
This module requires vbuild to be installed as devDependency.
yarn add vbuild vbuild-karma --devUsage
// config file: vbuild.karma.js
const karma = require('vbuild-karma')
module.exports = {
// in test we don't need to split vendor code and minimize it
vendor: false,
minimize: false,
// run custom build process
run(webpackConfig) {
karma(webpackConfig)
}
}We use karma-phantomjs-launcher karma-spec-reporter karma-jasmine jasmine-core by default.
In Continuous Integration Environment like CircleCi and TravisCi, the singleRun mode of Karma will be enabled.
Configure npm scripts
{
"scripts": {
"test": "vbuild -c vbuild.karma.js"
}
}You can run the example by:
git clone https://github.com/egoist/vbuild-karma.git
cd vbuild-karma
yarn
yarn exampleAPI
karma(webpackConfig, testFiles, karmaConfig)
webpackConfig
Final webpack config from vbuild
testFiles
Default: ['test/unit/**/*.test.js']
karmaConfig
Type: object string
When providing an object as karmaConfig, it will be assigned to default karma config we use.
When providing a string as karmaConfig, it will be treated as the path to karma config file, eg: ./test/unit/karma.conf.js, and it will totally override the default karma config.
Contributing
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature - Commit your changes:
git commit -am 'Add some feature' - Push to the branch:
git push origin my-new-feature - Submit a pull request :D
Author
vbuild-karma © egoist, Released under the MIT License. Authored and maintained by egoist with help from contributors (list).
egoistian.com · GitHub @egoist · Twitter @rem_rin_rin