Sha256: 8842d0cf35c28c7fff6b38bb775f11ecd4f33b8d8df89754f482e78669373d76

Contents?: true

Size: 900 Bytes

Versions: 7

Compression:

Stored size: 900 Bytes

Contents

var mdeps = require('../');
var test = require('tap').test;
var JSONStream = require('JSONStream');
var packer = require('browser-pack');
var through = require('through2');
var path = require('path');

test('transform', function (t) {
    t.plan(3);
    var p = mdeps({
        transform: function (file) {
            return through(function (buf, enc, next) {
                this.push(String(buf)
                    .replace(/AAA/g, '5')
                    .replace(/BBB/g, '50')
                );
                next();
            });
        },
        transformKey: [ 'browserify', 'transform' ]
    });
    p.end(path.join(__dirname, '/files/tr_sh/main.js'));
    var pack = packer();
    
    p.pipe(JSONStream.stringify()).pipe(pack);
    
    var src = '';
    pack.on('data', function (buf) { src += buf });
    pack.on('end', function () {
        Function('t', src)(t);
    });
});

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
minimum_viable_product-0.0.11 test/dummy/node_modules/module-deps/test/tr_fn.js
brwy_rails-0.0.6 test/dummy/node_modules/module-deps/test/tr_fn.js
brwy_rails-0.0.5 test/dummy/node_modules/module-deps/test/tr_fn.js
brwy_rails-0.0.4 test/dummy/node_modules/module-deps/test/tr_fn.js
brwy_rails-0.0.3 test/dummy/node_modules/module-deps/test/tr_fn.js
brwy_rails-0.0.2 test/dummy/node_modules/module-deps/test/tr_fn.js
brwy_rails-0.0.1 test/dummy/node_modules/module-deps/test/tr_fn.js