Skip to content

Commit

Permalink
plugin tests
Browse files Browse the repository at this point in the history
  • Loading branch information
James Halliday committed Jul 24, 2014
1 parent e713e99 commit 89058e7
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/node_modules/plugin-foo/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions test/plugin.js
@@ -0,0 +1,28 @@
var browserify = require('../');
var vm = require('vm');
var test = require('tap').test;

test('plugin fn', function (t) {
t.plan(2);

var b = browserify(__dirname + '/plugin/main.js');
b.plugin(function (b_) {
t.equal(b, b_);
});

b.bundle(function (err, src) {
t.ifError(err);
});
});

test('plugin module', function (t) {
t.plan(2);

var b = browserify(__dirname + '/plugin/main.js');
b.plugin('plugin-foo', { msg: 'beep boop' });

b.bundle(function (err, src) {
t.ifError(err);
t.equal(src, 'beep boop');
});
});
1 change: 1 addition & 0 deletions test/plugin/main.js
@@ -0,0 +1 @@
module.exports = 555

0 comments on commit 89058e7

Please sign in to comment.