Sha256: b7d5fb70bd31961d58a391b9cd7e67e2ccb2ee8b643004ec52d405085ce358a7

Contents?: true

Size: 927 Bytes

Versions: 7

Compression:

Stored size: 927 Bytes

Contents

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

test('--debug passed to transforms', function (t) {
    var empty = require.resolve('../lib/_empty');

    t.plan(3);

    [true, false].forEach(function(debug) {
        var b = browserify(empty, { debug: debug });

        b.transform(function(file, opts) {
            t.equal(opts._flags.debug, debug, 'debug: ' + debug);
            return through();
        });

        b.bundle(function (err, src) {
            if (err) return t.fail(err.message);
        });
    });

    var b = browserify(empty, { debug: true });

    b.transform({
        _flags: Infinity
    }, function(file, opts) {
        t.equal(opts._flags, Infinity, 'transform arguents are preserved');
        return through();
    });

    b.bundle(function(err, src) {
        if (err) return t.fail(err.message);
    });
});

Version data entries

7 entries across 7 versions & 2 rubygems

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