Skip to content
Discussion options

You must be logged in to vote

Annotating from the fixture does reach the default reporter on a failing test. Ran this on 4.1.11:

const randomTest = test.extend("random", async ({ annotate }) => {
  const seed = 1234567;
  await annotate(`Random seed: ${seed}`, "random-seed");
  return seed;
});

randomTest("failing case", ({ random }) => {
  expect(random).toBe(-1);
});
 ❯ seed.test.ts:14:18
 ❯ seed.test.ts:5:9 random-seed
   ↳ Random seed: 1234567

The line number in the annotation is the fixture, not the test body, so it is definitely the fixture's call being reported.

The thing that produces exactly your screenshot is a failing test that doesn't pull the fixture out of the context. Fixtures are lazy, so nothing run…

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@pindatm
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@pindatm
Comment options

Answer selected by pindatm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants