nyc-bookstores/node_modules/browserify/test/catch.js

23 lines
556 B
JavaScript
Raw Normal View History

2013-05-27 20:45:59 +00:00
var browserify = require('../');
var test = require('tap').test;
test('catch pipeline errors with a callback', function (t) {
t.plan(2);
var b = browserify(__dirname + '/catch/main.js');
b.bundle(function (err, src) {
t.ok(err);
t.ok(/no_such_file/.test(err));
});
});
test('catch pipeline errors with an event', function (t) {
t.plan(2);
var b = browserify(__dirname + '/catch/main.js').bundle();
b.on('error', function (err) {
t.ok(err);
t.ok(/no_such_file/.test(err));
});
});