Socket
Socket
Sign inDemoInstall

karma-bro

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

karma-bro - npm Package Compare versions

Comparing version 0.4.0 to 0.5.0

example/lib/fail.js

18

lib/bro.js

@@ -123,2 +123,11 @@ 'use strict';

_.forEach(bopts.plugin, function(p) {
// ensure we can pass plugin options as
// the first parameter
if (!Array.isArray(p)) {
p = [p];
}
bundle.plugin.apply(bundle, p);
});
_.forEach(bopts.transform, function(t) {

@@ -242,5 +251,10 @@ // ensure we can pass transform options as

function updateSourceMap(file, content) {
var map;
if (debug) {
var map = convert.fromSource(content);
file.sourceMap = map.sourcemap;
map = convert.fromSource(content);
if (map) {
file.sourceMap = map.sourcemap;
}
}

@@ -247,0 +261,0 @@ }

9

package.json

@@ -9,3 +9,3 @@ {

],
"version": "0.4.0",
"version": "0.5.0",
"scripts": {

@@ -31,9 +31,10 @@ "test": "grunt test",

"grunt": "~0.4.4",
"grunt-contrib-jshint": "~0.10.0",
"grunt-jasmine-node": "~0.2.1",
"grunt-contrib-jshint": "~0.10.0",
"grunt-release": "~0.7.0",
"load-grunt-tasks": "~0.4.0",
"karma": ">=0.10",
"watchify": "~0.8",
"brfs": "^1.1.1"
"watchify": "^0.10.2",
"brfs": "^1.1.1",
"tsify": "^0.1.4"
},

@@ -40,0 +41,0 @@ "peerDependencies": {

@@ -53,2 +53,3 @@ # karma-bro

* transform
* plugin

@@ -55,0 +56,0 @@ To generate source maps for easier debugging specify `debug: true` as an additional configuration option.

@@ -396,3 +396,3 @@ 'use strict';

browserify: {
transform: [ [{ foo: 'bar' }, 'brfs'] ]
transform: [ ['brfs', { foo: 'bar' }] ]
}

@@ -416,4 +416,58 @@ });

it('should configure debug with source map support', function(done) {
// given
var plugin = createPlugin({
browserify: {
debug: true
}
});
var bundleFile = createFile(bundle.location);
var testFile = createFile('test/fixtures/a.js');
// when
plugin.preprocess(bundleFile, [ testFile ], function() {
// then
// contains source map
expect(bundleFile.bundled).toContain("//# sourceMappingURL");
// and has the parsed mapping attached
expect(bundleFile.sourceMap).toBeDefined();
done();
});
});
it('should configure plugin with options', function(done) {
// given
var plugin = createPlugin({
browserify: {
plugin: [ ['tsify', { removeComments: true } ] ]
}
});
var bundleFile = createFile(bundle.location);
var testFile = createFile('test/fixtures/plugin.ts');
// when
plugin.preprocess(bundleFile, [ testFile ], function() {
// then
// bundle file got processed via plug-in
expect(bundleFile.bundled).toContain('module.exports = plugin');
expect(bundleFile.bundled).not.toContain('// typescript');
done();
});
});
});
});
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