Skip to content

Commit 64b7755

Browse files
Coutonovemberborn
authored andcommitted
Add t.log() for Flow and TypeScript (#1538)
Fixes #1498.
1 parent 8955e15 commit 64b7755

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

index.js.flow

+1
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ type TestContext = AssertContext & {
8484
title: string;
8585
plan(count: number): void;
8686
skip: AssertContext;
87+
log(message: string): void;
8788
};
8889
type ContextualTestContext = TestContext & { context: any; };
8990
type ContextualCallbackTestContext = TestContext & { context: any; end(): void; };

types/base.d.ts

+4
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ export interface TestContext extends AssertContext {
9999
plan(count: number): void;
100100

101101
skip: AssertContext;
102+
/**
103+
* Print a log message contextually alongside the test result instead of immediately printing it to stdout like console.log.
104+
*/
105+
log(message: string): void;
102106
}
103107
export interface CallbackTestContext extends TestContext {
104108
/**

0 commit comments

Comments
 (0)