Power Assert instrumentor module for webpack.
webpack-espower-loader
is a webpack loader module for power-assert.
webpack-espower-loader
applies espower to target sources through webpack loader chain.
Pull-requests, issue reports and patches are always welcomed.
See power-assert project for more documentation.
webpack-espower-loader does not work with babel-loader due to the change of transpiled code since babel 5.0. Please use babel-plugin-espower with babel-loader.
Install power-assert
and webpack-espower-loader
via npm:
$ npm install --save-dev webpack-espower-loader
For webpack3 or lower, you need to use the 1.x release of webpack-espower-loader.
$ npm install --save-dev [email protected]
Configure webpack.config.js
to apply webpack-espower-loader
through webpack loader transformation chain. Options are passed through to espower.
If not passed, default options (Same as espower.defaultOptions()) will be used.
{
module: {
exprContextCritical: false,
rules: [{
test: /_test\.js$/,
use: [{
loader: "webpack-espower-loader",
options: {
patterns: [
'assert(value, [message])',
'assert.ok(value, [message])',
'assert.equal(actual, expected, [message])',
'assert.notEqual(actual, expected, [message])',
'assert.strictEqual(actual, expected, [message])',
'assert.notStrictEqual(actual, expected, [message])',
'assert.deepEqual(actual, expected, [message])',
'assert.notDeepEqual(actual, expected, [message])'
]
}
}]
}]
}
}
See CHANGELOG.md.
Licensed under the MIT license. See LICENSE.