Skip to content
This repository has been archived by the owner on May 11, 2018. It is now read-only.

Fill data with electron as a target. #229

Merged
merged 11 commits into from
Mar 29, 2017
Prev Previous commit
Next Next commit
Remove getTargets + electron from tests.
  • Loading branch information
yavorsky committed Mar 28, 2017
commit 36656534a3bcfa7f111040f42f1204289a778c0a
64 changes: 0 additions & 64 deletions test/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,70 +21,6 @@ describe("babel-preset-env", () => {
});
});

describe("getTargets + electron", () => {
it("should work with a string", function() {
assert.deepEqual(babelPresetEnv.getTargets({
electron: "1.0"
}), {
chrome: 49
});
});

it("should work with a number", function() {
assert.deepEqual(babelPresetEnv.getTargets({
electron: 1.0
}), {
chrome: 49
});
});


it("should preserve lower Chrome number if Electron version is more recent", function() {
assert.deepEqual(babelPresetEnv.getTargets({
electron: 1.4,
chrome: 50
}), {
chrome: 50
});
});

it("should overwrite Chrome number if Electron version is older", function() {
assert.deepEqual(babelPresetEnv.getTargets({
electron: 1.0,
chrome: 50
}), {
chrome: 49
});
});

Object.keys(electronToChromiumData).forEach((electronVersion) => {
it(`"should work for Electron: ${electronVersion}`, function() {
assert.deepEqual(babelPresetEnv.getTargets({
electron: electronVersion
}), {
chrome: electronToChromiumData[electronVersion]
});
});
});

it("should error if electron version is invalid", () => {
const fixtures = [
"0.19",
0.19,
999,
"999",
];

fixtures.forEach((electronVersion) => {
assert.throws(() => {
babelPresetEnv.getTargets({
electron: electronVersion,
});
}, Error);
});
});
});

describe("getTargets + uglify", () => {
it("should work with `true`", function() {
assert.deepEqual(babelPresetEnv.getTargets({
Expand Down