JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1059
  • Score
    100M100P100Q101512F

A gulp plugin for power-assert

Package Exports

  • gulp-espower

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (gulp-espower) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

gulp-espower NPM version Build Status Dependency Status

A gulp plugin for power-assert.

Description

gulp-espower is a gulp plugin to instrument "Power Assert" feature into your code.

Internally, gulp-espower task uses espower module that manipulates assertion expression (JavaScript Code) represented as Mozilla JavaScript AST, to instrument power-assert feature into the code. The magic is done by using Esprima and Escodegen.

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

Usage

First, install gulp-espower as a development dependency:

npm install --save-dev gulp-espower

Then, add it to your gulpfile.js:

var espower = require("gulp-espower");

gulp.src("./test/*.js")
    .pipe(espower())
    .pipe(gulp.dest("./dist"));

API

espower(options)

options.powerAssertVariableName

Type: String Default value: 'assert'

Target variable name to instrument.

options.lineSeparator

Type: String Default value: '\n'

Line separator in target sources.

options.targetMethods

Type: Object Default value:

targetMethods: {
    oneArg: [
        'ok'
    ],
    twoArgs: [
        'equal',
        'notEqual',
        'strictEqual',
        'notStrictEqual',
        'deepEqual',
        'notDeepEqual'
    ]
}

Target assertion methods to insrtument.

  • oneArg array for assertion methods with a expression argument (like assert.ok(actual))
  • twoArgs array for assertion methods with two expression arguments (like assert.equal(actual, expected))

License

Licensed under the MIT license.