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

Version Path
minimum_viable_product-0.0.11 test/dummy/node_modules/browserify/test/pkg_event.js
brwy_rails-0.0.6 test/dummy/node_modules/browserify/test/pkg_event.js
brwy_rails-0.0.5 test/dummy/node_modules/browserify/test/pkg_event.js
brwy_rails-0.0.4 test/dummy/node_modules/browserify/test/pkg_event.js
brwy_rails-0.0.3 test/dummy/node_modules/browserify/test/pkg_event.js
brwy_rails-0.0.2 test/dummy/node_modules/browserify/test/pkg_event.js
brwy_rails-0.0.1 test/dummy/node_modules/browserify/test/pkg_event.js