New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@eventmobi/babel-istanbul-instrumenter-loader

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@eventmobi/babel-istanbul-instrumenter-loader

babel stanbul instrumenter loader

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Babel istanbul instrumenter loader for webpack

Fork from deepsweet/istanbul-instrumenter-loader

Install

$ npm install @eventmobi/babel-istanbul-instrumenter-loader

Usage

Useful to work together with webpack and gulp-istanbul.

  1. webpack.spec.config.js
{ 
    test: /\.jsx?$/, 
    exclude: /(node_modules|build|test)/, 
    loader: 'babel-istanbul-instrumenter'
}
  1. gulpfile.js
var gulp = require('gulp'),
    gutil = require('gulp-util'),
    mocha = require('gulp-mocha'),
    istanbul = require('gulp-istanbul'),
    connect = require('gulp-connect'),
    runSeq = require('run-sequence'),
    webpack = require('webpack'),
    webpackSpecConfig = require('./webpack.spec.config');

// build specification bundle file
gulp.task('build:spec', function (done) {
  webpack(webpackSpecConfig, function (err, stats) {
    if (err) throw new gutil.PluginError("webpack-spec", err);
    //gutil.log("[webpack-spec]", stats.toString());
    done();
  });
});

gulp.task('coverage:server', function() { 
  var host = '0.0.0.0',
    port = 4004;

  gutil.log('Open your browser and visit http://' + host + ':' + port + 'to view the coverage report. ctrl+c to quit.');
  connect.server({
    root: './coverage/lcov-report',
    port: port,
    host: host
  });
});

// run test
gulp.task('test', ['build:spec'], function (done) {
  gulp.src('test/start.js')
    .pipe(mocha())
    .pipe(istanbul.writeReports({
      coverageVariable: '__coverage__',
      dir: './coverage',
      reporters: ['lcov', 'json', 'text', 'text-summary']
    }))
    .on('end', function () {
      runSeq('coverage:server', done);
    });
});

$ gulp test

Keywords

FAQs

Package last updated on 20 Aug 2020

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