Sha256: 09426f30773842a5329e42eb34047933d6d60be67ff5d63264908f6c52fde3fd
Contents?: true
Size: 818 Bytes
Versions: 7
Compression:
Stored size: 818 Bytes
Contents
var browserify = require('../'); var path = require('path'); var vm = require('vm'); var test = require('tap').test; var expected = [ readpkg('pkg_event'), readpkg('pkg_event/node_modules/aaa'), readpkg('pkg_event/node_modules/aaa/lib') ]; test('package event', function (t) { t.plan(2 + expected.length); var b = browserify(__dirname + '/pkg_event/main.js'); b.on('package', function (pkg) { t.deepEqual(pkg, expected.shift()); }); b.bundle(function (err, src) { t.ifError(err); vm.runInNewContext(src, { console: { log: log } }); function log (msg) { t.equal(msg, 555) } }); }); function readpkg (dir) { var pkg = require(path.join(__dirname, dir, 'package.json')); pkg.__dirname = path.join(__dirname, dir); return pkg; }
Version data entries
7 entries across 7 versions & 2 rubygems