Sha256: 8611039ddbcac06c5f48d2b58813d5335ffca284c8e18a3458f42c2d8b3782eb

Contents?: true

Size: 802 Bytes

Versions: 7

Compression:

Stored size: 802 Bytes

Contents

var test = require('tap').test;
var pack = require('../');

test('trailing comment', function (t) {
    t.plan(5);
    
    var p = pack({ raw: true });
    var src = '';
    p.on('data', function (buf) { src += buf });
    p.on('end', function () {
        var r = Function(['T'], 'return ' + src)(t);
        t.equal(r('xyz')(5), 555);
        t.equal(r('xyz')(5), 555);
        t.throws(function() {
            r('zzz');
        }, /Cannot find module 'zzz'/);
    });
    
    p.write({
        id: 'abc',
        source: 'T.equal(require("./xyz")(3), 333)',
        entry: true,
        deps: { './xyz': 'xyz' }
    });
    
    p.write({
        id: 'xyz',
        source: 'T.ok(true); module.exports=function(n){return n*111}'
            + ' // trailing comment'
    });
    
    p.end();
});

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
minimum_viable_product-0.0.11 test/dummy/node_modules/browser-pack/test/comment.js
brwy_rails-0.0.6 test/dummy/node_modules/browser-pack/test/comment.js
brwy_rails-0.0.5 test/dummy/node_modules/browser-pack/test/comment.js
brwy_rails-0.0.4 test/dummy/node_modules/browser-pack/test/comment.js
brwy_rails-0.0.3 test/dummy/node_modules/browser-pack/test/comment.js
brwy_rails-0.0.2 test/dummy/node_modules/browser-pack/test/comment.js
brwy_rails-0.0.1 test/dummy/node_modules/browser-pack/test/comment.js