Skip to content

Commit bd3d245

Browse files
timreichenkt3k
andauthored
test(fmt): reduce unnecessary output during test run (#6596)
Co-authored-by: Yoshiya Hinosawa <[email protected]>
1 parent ad37d36 commit bd3d245

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

fmt/printf_test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import { printf, sprintf } from "./printf.ts";
99
import { assertEquals, assertThrows } from "@std/assert";
10-
import { assertSpyCall, spy } from "@std/testing/mock";
10+
import { assertSpyCall, spy, stub } from "@std/testing/mock";
1111
import * as c from "./colors.ts";
1212

1313
Deno.test("sprintf() handles noVerb", function () {
@@ -786,7 +786,8 @@ Deno.test("sprintf() throws with d with sharp option", () => {
786786
});
787787

788788
Deno.test("printf() prints the result synchronously", () => {
789-
using writeSpy = spy(Deno.stdout, "writeSync");
789+
const writeSpy = spy(() => 1);
790+
using _ = stub(Deno.stdout, "writeSync", writeSpy);
790791
printf("Hello %s", "world");
791792

792793
assertSpyCall(writeSpy, 0, {

0 commit comments

Comments
 (0)