Files
babel/packages/babel-core/test/browserify.js
Deven Bansod f3f0197890 Migrate babel-core tests to use jest-expect (#7513)
* Used codemods at: https://gist.github.com/devenbansod/03c5cff857661e076cbec72fcb2e7eb3 along with some manual intervention and review
2018-03-10 11:40:28 +01:00

21 lines
583 B
JavaScript

import browserify from "browserify";
import path from "path";
import vm from "vm";
describe("browserify", function() {
it("@babel/register may be used without breaking browserify", function(done) {
const bundler = browserify(
path.join(__dirname, "fixtures/browserify/register.js"),
);
bundler.bundle(function(err, bundle) {
if (err) return done(err);
expect(bundle.length).toBeTruthy();
// ensure that the code runs without throwing an exception
vm.runInNewContext("var global = this;\n" + bundle, {});
done();
});
});
});