Skip to content

Commit

Permalink
Add t.log() for Flow and TypeScript (#1538)
Browse files Browse the repository at this point in the history
Fixes #1498.
  • Loading branch information
Couto authored and novemberborn committed Oct 1, 2017
1 parent 8955e15 commit 64b7755
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions index.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ type TestContext = AssertContext & {
title: string;
plan(count: number): void;
skip: AssertContext;
log(message: string): void;
};
type ContextualTestContext = TestContext & { context: any; };
type ContextualCallbackTestContext = TestContext & { context: any; end(): void; };
Expand Down
4 changes: 4 additions & 0 deletions types/base.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ export interface TestContext extends AssertContext {
plan(count: number): void;

skip: AssertContext;
/**
* Print a log message contextually alongside the test result instead of immediately printing it to stdout like console.log.
*/
log(message: string): void;
}
export interface CallbackTestContext extends TestContext {
/**
Expand Down

0 comments on commit 64b7755

Please sign in to comment.