Skip to content

Commit

Permalink
test: Show more details when jest test fails
Browse files Browse the repository at this point in the history
By checking the snapshot first Jest will hopefully give us
more information on the test that's randomly failing in CI.
  • Loading branch information
dividedmind committed Apr 24, 2024
1 parent 2088796 commit fba6d58
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/jest.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { format } from "node:util";

Check failure on line 1 in test/jest.test.ts

View workflow job for this annotation

GitHub Actions / lint

'format' is defined but never used

import { integrationTest, readAppmaps, runAppmapNode, runAppmapNodeWithOptions } from "./helpers";

integrationTest("mapping Jest tests", () => {
Expand All @@ -19,8 +21,9 @@ integrationTest("mapping Jest tests with process recording active", () => {
).status,
).toBe(1);
const appmaps = readAppmaps();
expect(appmaps).toMatchSnapshot();

const appmapsArray = Object.values(appmaps);
expect(appmapsArray.filter((a) => a.metadata?.recorder.type == "process").length).toEqual(1);
expect(appmapsArray.filter((a) => a.metadata?.recorder.type == "tests").length).toEqual(5);
expect(appmaps).toMatchSnapshot();
});

0 comments on commit fba6d58

Please sign in to comment.