Skip to content

First test name missing in output when using assertSnapshot (but only when not piped) #31768

@nnmrts

Description

@nnmrts

Version: Deno 2.6.3
MacOS: 26.1 (25B77)

Consider this minimal example:

test.js:

import { assertSnapshot } from "jsr:@std/testing/snapshot";

Deno.test("test-0", async (context) => {
	await assertSnapshot(context, "x");
});

Deno.test("test-1", async (context) => {
	await assertSnapshot(context, "x");
});

Now run this test:

deno test -A test.js

And this will be the output:

running 2 tests from ./test.js
 ok (1ms)
test-1 ... ok (6ms)

ok | 2 passed | 0 failed (8ms)

This is missing the first test name ("test-0").

Now run this test but pipe both stderr and stdout to cat:

deno test -A test.js 2>&1 | cat

And this will be the output:

running 2 tests from ./test.js
test-0 ... ok (1ms)
test-1 ... ok (5ms)

ok | 2 passed | 0 failed (8ms)

Metadata

Metadata

Assignees

No one assigned

    Labels

    testingrelated to deno test and coverage

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions