Restrict Babel's plugins/presets to a single target. (#5547)

This commit is contained in:
Logan Smyth
2017-04-17 11:45:49 -07:00
committed by GitHub
parent c59e9f5f0e
commit 2b86d353d6
31 changed files with 463 additions and 110 deletions

View File

@@ -116,11 +116,13 @@ describe("api", function () {
});
it("exposes the resolvePlugin method", function() {
assert.equal(babel.resolvePlugin("nonexistent-plugin"), null);
assert.throws(() => babel.resolvePlugin("nonexistent-plugin"),
/Cannot find module 'babel-plugin-nonexistent-plugin'/);
});
it("exposes the resolvePreset method", function() {
assert.equal(babel.resolvePreset("nonexistent-preset"), null);
assert.throws(() => babel.resolvePreset("nonexistent-preset"),
/Cannot find module 'babel-preset-nonexistent-preset'/);
});
it("transformFile", function (done) {