Skip to content

Commit

Permalink
Remove unnecessary Set cast in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolo-ribaudo committed Jan 11, 2022
1 parent 5986b34 commit 9d1a684
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions packages/babel-core/test/external-dependencies.js
Expand Up @@ -30,7 +30,18 @@ describe("externalDependencies", () => {
plugins: [makePlugin("./foo")],
});

expect(new Set(externalDependencies)).toEqual(new Set(["./foo"]));
expect(externalDependencies).toEqual(new Set(["./foo"]));
});

it("returns a fresh set", () => {
const options = {
plugins: [makePlugin("./foo")],
};
const res1 = transform("", options);
const res2 = transform("", options);

expect(res1.externalDependencies).toEqual(res2.externalDependencies);
expect(res1.externalDependencies).not.toBe(res2.externalDependencies);
});

it("can be set multiple times by the same plugin", () => {
Expand All @@ -45,15 +56,15 @@ describe("externalDependencies", () => {
],
});

expect(new Set(externalDependencies)).toEqual(new Set(["./foo", "./bar"]));
expect(externalDependencies).toEqual(new Set(["./foo", "./bar"]));
});

it("can be set by presets", () => {
const { externalDependencies } = transform("", {
presets: [makePreset("./foo")],
});

expect(new Set(externalDependencies)).toEqual(new Set(["./foo"]));
expect(externalDependencies).toEqual(new Set(["./foo"]));
});

it("can be set multiple times by the same preset", () => {
Expand All @@ -68,7 +79,7 @@ describe("externalDependencies", () => {
],
});

expect(new Set(externalDependencies)).toEqual(new Set(["./foo", "./bar"]));
expect(externalDependencies).toEqual(new Set(["./foo", "./bar"]));
});

it("can be set by multiple plugins and presets", () => {
Expand All @@ -82,7 +93,7 @@ describe("externalDependencies", () => {
],
});

expect(new Set(externalDependencies)).toEqual(
expect(externalDependencies).toEqual(
new Set([
"./plugin1",
"./plugin2",
Expand Down

0 comments on commit 9d1a684

Please sign in to comment.