Power Assert feature instrumentor on the fly

npm install espower-loader
1 downloads in the last day
129 downloads in the last week
373 downloads in the last month


Build Status NPM version Dependency Status Built with Grunt

Power Assert feature instrumentor on the fly.


espower-loader is a Node.js module loader that enhances target sources on the fly. So you can instrument Power Assert feature without code generation for now.

espower-loader applies espower to target sources on loading them. espower manipulates assertion expression (JavaScript Code) represented as Mozilla JavaScript AST, to instrument power-assert feature into the code.

Please note that espower-loader is a beta version product. Pull-requests, issue reports and patches are always welcomed. See power-assert project for more documentation.

FYI: You may be interested in intelli-espower-loader to go one step further. With intelli-espower-loader, you don't need to create loader file (like enable-power-assert.js). Just define test directory in package.json wow!


You can instrument power-assert without code generation (e.g. without using grunt-espower).

For mocha, Just add --require option.

$ mocha --require ./path/to/enable-power-assert test/some_test_using_powerassert.js

where enable-power-assert.js somewhere in your project is,

    cwd: process.cwd(),
    pattern: 'test/**/*.js'

You can specify espower options explicitly.


    // directory where match starts with
    cwd: process.cwd(),

    // glob pattern using minimatch module
    pattern: 'test/**/*.js',

    // options for espower module
    espowerOptions: {
        destructive: false,
        powerAssertVariableName: 'assert',
        lineSeparator: '\n',
        targetMethods: {
            oneArg: [
            twoArgs: [



Licensed under the MIT license.

npm loves you