Sha256: a12c6c596362926cb007c9e940a30a2e275de84534fef271a9279cebebeb0427

Contents?: true

Size: 966 Bytes

Versions: 7

Compression:

Stored size: 966 Bytes

Contents

var browserify = require('../');
var vm = require('vm');
var test = require('tap').test;

test('hash instances with hashed contexts', function (t) {
    t.plan(17);
    
    var b = browserify(__dirname + '/hash_instance_context/main.js');
    b.bundle(function (err, buf) {
        var c = { t: t };
        var src = buf.toString('utf8');
        t.equal(src.match(RegExp('// FILE F ONE', 'g')).length, 1);
        t.equal(src.match(RegExp('// FILE G ONE', 'g')).length, 2);
        
        t.equal(src.match(RegExp('// FILE F TWO', 'g')).length, 1);
        t.equal(src.match(RegExp('// FILE G TWO', 'g')).length, 1);
        t.equal(src.match(RegExp('// FILE H TWO', 'g')).length, 2);
        
        t.equal(src.match(RegExp('// FILE F THREE', 'g')).length, 1);
        t.equal(src.match(RegExp('// FILE G THREE', 'g')).length, 1);
        t.equal(src.match(RegExp('// FILE H THREE', 'g')).length, 1);
        
        vm.runInNewContext(src, c);
    });
});

Version data entries

7 entries across 7 versions & 2 rubygems

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