Skip to content

Commit

Permalink
refactor(test): Assert on loadJsonFile.registry.keys(), not snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
evocateur committed Oct 21, 2019
1 parent 99425f7 commit 840392f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
10 changes: 4 additions & 6 deletions commands/publish/__tests__/publish-lifecycle-scripts.test.js
Expand Up @@ -71,12 +71,10 @@ describe("lifecycle scripts", () => {
["lifecycle", "postpublish"],
]);

expect(loadJsonFile.registry).toMatchInlineSnapshot(`
Map {
"/packages/package-1" => 4,
"/packages/package-2" => 4,
}
`);
expect(Array.from(loadJsonFile.registry.keys())).toStrictEqual([
"/packages/package-1",
"/packages/package-2",
]);
});

it("does not execute recursive root scripts", async () => {
Expand Down
10 changes: 4 additions & 6 deletions commands/version/__tests__/version-lifecycle-scripts.test.js
Expand Up @@ -59,12 +59,10 @@ describe("lifecycle scripts", () => {
["lifecycle", "postversion"],
]);

expect(loadJsonFile.registry).toMatchInlineSnapshot(`
Map {
"/packages/package-1" => 2,
"/packages/package-2" => 2,
}
`);
expect(Array.from(loadJsonFile.registry.keys())).toStrictEqual([
"/packages/package-1",
"/packages/package-2",
]);
});

it("does not execute recursive root scripts", async () => {
Expand Down

0 comments on commit 840392f

Please sign in to comment.