Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

espower-loader

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

espower-loader

Power Assert feature instrumentor on the fly

  • 1.2.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

espower-loader

Build Status NPM package Dependency Status

Power Assert feature instrumentor on the fly.

DESCRIPTION

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).

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,

require('espower-loader')({
    pattern: '{src,test}/**/*.js'
});

You can specify options for espower module explicitly.

require('espower-loader')({

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

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

    // options for espower module
    espowerOptions: {
        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.

CHANGELOG

See CHANGELOG

AUTHOR

CONTRIBUTORS

LICENSE

Licensed under the MIT license.

Keywords

FAQs

Package last updated on 24 Apr 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc