All Projects → power-assert-js → webpack-espower-loader

power-assert-js / webpack-espower-loader

Licence: MIT license
Power Assert instrumentor module for webpack

Programming Languages

javascript
184084 projects - #8 most used programming language

Build Status NPM package Dependency Status License

webpack-espower-loader

Power Assert instrumentor module for webpack.

Description

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.

FAQ

webpack-espower-loader does not work with babel-loader!

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.

Installation

Install power-assert and webpack-espower-loader via npm:

$ npm install --save-dev webpack-espower-loader

Caution

For webpack3 or lower, you need to use the 1.x release of webpack-espower-loader.

$ npm install --save-dev [email protected]

Usage

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])'
                    ]
                }
            }]
        }]
    }
}

Changelog

See CHANGELOG.md.

Author

Contributors

License

Licensed under the MIT license. See LICENSE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].