You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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) in the form of ECMAScript AST defined in The ESTree Spec (formerly known as Mozilla SpiderMonkey Parser API), to instrument power-assert feature into the code. espower-loader also adjusts line and column number in stack traces by using source-map-support module.
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!
EXAMPLE
You can instrument power-assert without code generation (e.g. without using grunt-espower,gulp-espower, and so on).
You can specify options for espower module explicitly.
require('espower-loader')({// directory where match starts withcwd: process.cwd(),// glob pattern using minimatch modulepattern: '{src,test}/**/*.js',// options for espower moduleespowerOptions: {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])','assert.deepStrictEqual(actual, expected, [message])','assert.notDeepStrictEqual(actual, expected, [message])']}});
OUR SUPPORT POLICY
We support Node under maintenance. In other words, we stop supporting old Node version when their maintenance ends.
This means that any other environment is not supported.
NOTE: If espower-source works in any of the unsupported environments, it is purely coincidental and has no bearing on future compatibility. Use at your own risk.