diff --git a/packages/babel-preset-es2015/test/index.js b/packages/babel-preset-es2015/test/index.js index 99ac458986..ffb1683dd3 100644 --- a/packages/babel-preset-es2015/test/index.js +++ b/packages/babel-preset-es2015/test/index.js @@ -18,6 +18,14 @@ describe("es2015 preset", function () { }); }); + describe("spec", function () { + it("throws on non-boolean value", function () { + expect(function () { + es2015(null, { spec: 1 }); + }).to.throw(/must be a boolean/); + }); + }); + describe("modules", function () { it("doesn't throw when passing one false", function () { expect(function () { @@ -42,6 +50,12 @@ describe("es2015 preset", function () { es2015(null, { modules: "systemjs" }); }).not.to.throw(); }); + + it("throws when passing neither false nor one of: 'commonjs', 'amd', 'umd', 'systemjs'", function () { + expect(function () { + es2015(null, { modules: 1 }); + }).to.throw(); + }); }); }); });