Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions types/base.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,5 +120,13 @@ export interface ContextualCallbackTestContext extends CallbackTestContext {
context: any;
}

export interface Macro<T> {
(t: T, ...args: any[]): void;
title? (providedTitle: string, ...args: any[]): string;
}
export type Macros<T> = Macro<T> | Macro<T>[];

export function test(name: string, run: ContextualTest): void;
export function test(run: ContextualTest): void;
export function test(name: string, run: Macros<ContextualTestContext>, ...args: any[]): void;
export function test(run: Macros<ContextualTestContext>, ...args: any[]): void;
2 changes: 2 additions & 0 deletions types/make.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ function generatePrefixed(prefix) {
const type = testType(parts);
output += '\t' + writeFunction(part, 'name: string, implementation: ' + type);
output += '\t' + writeFunction(part, 'implementation: ' + type);
output += '\t' + writeFunction(part, 'name: string, implementation: Macros<' + type + 'Context>, ...args: any[]');
output += '\t' + writeFunction(part, 'implementation: Macros<' + type + 'Context>, ...args: any[]');
}
}

Expand Down