From 15655254122b68c88e6425901c614f66cc6ca40c Mon Sep 17 00:00:00 2001 From: Anton Golub Date: Thu, 18 May 2023 16:24:53 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#65521=20feat(node)?= =?UTF-8?q?:=20extend=20test=20API=20shorthands=20by=20@antongolub?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://nodejs.org/en/blog/release/v20.2.0 https://nodejs.org/en/blog/release/v18.15.0 https://github.com/nodejs/node/pull/47909 https://github.com/nodejs/node/pull/46604 --- types/node/test.d.ts | 67 ++++++++++++------- types/node/test/test.ts | 87 +++++++++++++++++++++---- types/node/ts4.8/test.d.ts | 105 +++++++++++++++++------------- types/node/ts4.8/test/test.ts | 105 ++++++++++++++++++++++++++++-- types/node/v18/test.d.ts | 33 +++++++++- types/node/v18/test/test.ts | 38 +++++++++-- types/node/v18/ts4.8/test.d.ts | 32 ++++++++- types/node/v18/ts4.8/test/test.ts | 38 +++++++++-- 8 files changed, 405 insertions(+), 100 deletions(-) diff --git a/types/node/test.d.ts b/types/node/test.d.ts index 4560ffc44be558..405867fc3975b2 100644 --- a/types/node/test.d.ts +++ b/types/node/test.d.ts @@ -136,27 +136,20 @@ declare module 'node:test' { function test(options?: TestOptions, fn?: TestFn): Promise; function test(fn?: TestFn): Promise; namespace test { - /** - * Shorthand for skipping a suite, same as `test([name], { skip: true }[, fn])`. - */ - function skip(name?: string, options?: TestOptions, fn?: TestFn): void; - function skip(name?: string, fn?: TestFn): void; - function skip(options?: TestOptions, fn?: TestFn): void; - function skip(fn?: TestFn): void; - /** - * Shorthand for marking a suite as `TODO`, same as `test([name], { todo: true }[, fn])`. - */ - function todo(name?: string, options?: TestOptions, fn?: TestFn): void; - function todo(name?: string, fn?: TestFn): void; - function todo(options?: TestOptions, fn?: TestFn): void; - function todo(fn?: TestFn): void; - /** - * Shorthand for marking a suite as `TODO`, same as `test([name], { only: true }[, fn])`. - */ - function only(name?: string, options?: TestOptions, fn?: TestFn): void; - function only(name?: string, fn?: TestFn): void; - function only(options?: TestOptions, fn?: TestFn): void; - function only(fn?: TestFn): void; + export { + after, + afterEach, + before, + beforeEach, + describe, + it, + run, + mock, + test, + skip, + todo, + only + }; } /** * The `describe()` function imported from the `node:test` module. Each @@ -188,7 +181,8 @@ declare module 'node:test' { function todo(options?: TestOptions, fn?: SuiteFn): void; function todo(fn?: SuiteFn): void; /** - * Shorthand for marking a suite as `TODO`, same as `describe([name], { only: true }[, fn])`. + * Shorthand for marking a suite as `only`, same as `describe([name], { only: true }[, fn])`. + * @since v18.15.0 */ function only(name?: string, options?: TestOptions, fn?: SuiteFn): void; function only(name?: string, fn?: SuiteFn): void; @@ -217,13 +211,38 @@ declare module 'node:test' { function todo(options?: TestOptions, fn?: TestFn): void; function todo(fn?: TestFn): void; /** - * Shorthand for marking a suite as `TODO`, same as `it([name], { only: true }[, fn])`. + * Shorthand for marking a test as `only`, same as `it([name], { only: true }[, fn])`. + * @since v18.15.0 */ function only(name?: string, options?: TestOptions, fn?: TestFn): void; function only(name?: string, fn?: TestFn): void; function only(options?: TestOptions, fn?: TestFn): void; function only(fn?: TestFn): void; } + /** + * Shorthand for skipping a test, same as `test([name], { skip: true }[, fn])`. + * @since v20.2.0 + */ + function skip(name?: string, options?: TestOptions, fn?: TestFn): void; + function skip(name?: string, fn?: TestFn): void; + function skip(options?: TestOptions, fn?: TestFn): void; + function skip(fn?: TestFn): void; + /** + * Shorthand for marking a test as `TODO`, same as `test([name], { todo: true }[, fn])`. + * @since v20.2.0 + */ + function todo(name?: string, options?: TestOptions, fn?: TestFn): void; + function todo(name?: string, fn?: TestFn): void; + function todo(options?: TestOptions, fn?: TestFn): void; + function todo(fn?: TestFn): void; + /** + * Shorthand for marking a test as `only`, same as `test([name], { only: true }[, fn])`. + * @since v20.2.0 + */ + function only(name?: string, options?: TestOptions, fn?: TestFn): void; + function only(name?: string, fn?: TestFn): void; + function only(options?: TestOptions, fn?: TestFn): void; + function only(fn?: TestFn): void; /** * The type of a function under test. The first argument to this function is a * {@link TestContext} object. If the test uses callbacks, the callback function is passed as @@ -1025,5 +1044,5 @@ declare module 'node:test' { */ restore(): void; } - export { test as default, run, test, describe, it, before, after, beforeEach, afterEach, mock }; + export { test as default, run, test, describe, it, before, after, beforeEach, afterEach, mock, skip, only, todo }; } diff --git a/types/node/test/test.ts b/types/node/test/test.ts index 66ed7caa5d2d2f..2d774e494a77e3 100644 --- a/types/node/test/test.ts +++ b/types/node/test/test.ts @@ -1,4 +1,4 @@ -import { describe, it, run, test, before, beforeEach, after, afterEach } from 'node:test'; +import { describe, it, run, test, before, beforeEach, after, afterEach, skip, todo, only } from 'node:test'; // run without options // $ExpectType TestsStream @@ -53,6 +53,8 @@ test('options with booleans', { // Test callback mode test((t, cb) => { + // $ExpectedType TestContext + t; // $ExpectType (result?: any) => void cb; // $ExpectType void @@ -98,6 +100,24 @@ test(t => { // @ts-expect-error test(1, () => {}); +test.after(() => {}); +test.afterEach(() => {}); +test.before(() => {}); +test.beforeEach(() => {}); +test.describe('describe', () => {}); +test.it('it', () => {}); +// $ExpectType MockTracker +test.mock; +// $ExpectType typeof test +test.test; +test.test.test('chained self ref', (t) => { + // $ExpectType typeof test + t.test; +}); +test.skip('skip', () => {}); +test.todo('todo', () => {}); +test.only('only', () => {}); + describe('foo', () => { it('it', () => {}); }); @@ -132,56 +152,99 @@ it('options with booleans', { todo: false, }); +skip('skip shorthand', { + concurrency: 1, + skip: true, + signal: new AbortController().signal, + timeout: Infinity, +}); +skip((t, cb) => { + // $ExpectType TestContext + t; + // $ExpectType (result?: any) => void + cb; + // $ExpectType void + cb({ x: 'anything' }); +}); +test.skip('skip shorthand', { + concurrency: 1, + skip: true, + signal: new AbortController().signal, + timeout: Infinity, +}); describe.skip('skip shorthand', { concurrency: 1, - only: true, + skip: true, signal: new AbortController().signal, timeout: Infinity, }); it.skip('skip shorthand', { concurrency: 1, - only: true, + skip: true, signal: new AbortController().signal, timeout: Infinity, }); -test.skip('skip shorthand', { + +todo('todo shorthand', { concurrency: 1, - only: true, + todo: true, + signal: new AbortController().signal, + timeout: Infinity, +}); +todo((t, cb) => { + // $ExpectType TestContext + t; + // $ExpectType (result?: any) => void + cb; + // $ExpectType void + cb({ x: 'anything' }); +}); +test.todo('todo shorthand', { + concurrency: 1, + todo: true, signal: new AbortController().signal, timeout: Infinity, }); - describe.todo('todo shorthand', { concurrency: 1, - only: true, + todo: true, signal: new AbortController().signal, timeout: Infinity, }); it.todo('todo shorthand', { concurrency: 1, - only: true, + todo: true, signal: new AbortController().signal, timeout: Infinity, }); -test.todo('todo shorthand', { + +only('todo shorthand', { concurrency: 1, only: true, signal: new AbortController().signal, timeout: Infinity, }); -describe.only('only shorthand', { +only((t, cb) => { + // $ExpectType TestContext + t; + // $ExpectType (result?: any) => void + cb; + // $ExpectType void + cb({ x: 'anything' }); +}); +test.only('only shorthand', { concurrency: 1, only: true, signal: new AbortController().signal, timeout: Infinity, }); -it.only('only shorthand', { +describe.only('only shorthand', { concurrency: 1, only: true, signal: new AbortController().signal, timeout: Infinity, }); -test.only('only shorthand', { +it.only('only shorthand', { concurrency: 1, only: true, signal: new AbortController().signal, diff --git a/types/node/ts4.8/test.d.ts b/types/node/ts4.8/test.d.ts index 51614d357a202d..b76ae739e1023e 100644 --- a/types/node/ts4.8/test.d.ts +++ b/types/node/ts4.8/test.d.ts @@ -136,27 +136,20 @@ declare module 'node:test' { function test(options?: TestOptions, fn?: TestFn): Promise; function test(fn?: TestFn): Promise; namespace test { - /** - * Shorthand for skipping a suite, same as `test([name], { skip: true }[, fn])`. - */ - function skip(name?: string, options?: TestOptions, fn?: TestFn): void; - function skip(name?: string, fn?: TestFn): void; - function skip(options?: TestOptions, fn?: TestFn): void; - function skip(fn?: TestFn): void; - /** - * Shorthand for marking a suite as `TODO`, same as `test([name], { todo: true }[, fn])`. - */ - function todo(name?: string, options?: TestOptions, fn?: TestFn): void; - function todo(name?: string, fn?: TestFn): void; - function todo(options?: TestOptions, fn?: TestFn): void; - function todo(fn?: TestFn): void; - /** - * Shorthand for marking a suite as `TODO`, same as `test([name], { only: true }[, fn])`. - */ - function only(name?: string, options?: TestOptions, fn?: TestFn): void; - function only(name?: string, fn?: TestFn): void; - function only(options?: TestOptions, fn?: TestFn): void; - function only(fn?: TestFn): void; + export { + after, + afterEach, + before, + beforeEach, + describe, + it, + run, + mock, + test, + skip, + todo, + only + }; } /** * The `describe()` function imported from the `node:test` module. Each @@ -187,8 +180,10 @@ declare module 'node:test' { function todo(name?: string, fn?: SuiteFn): void; function todo(options?: TestOptions, fn?: SuiteFn): void; function todo(fn?: SuiteFn): void; + /** - * Shorthand for marking a suite as `TODO`, same as `describe([name], { only: true }[, fn])`. + * Shorthand for marking a suite as `only`, same as `describe([name], { only: true }[, fn])`. + * @since v18.15.0 */ function only(name?: string, options?: TestOptions, fn?: SuiteFn): void; function only(name?: string, fn?: SuiteFn): void; @@ -201,29 +196,54 @@ declare module 'node:test' { * The `it()` function is imported from the `node:test` module. * @since v18.6.0, v16.17.0 */ - function it(name?: string, options?: TestOptions, fn?: ItFn): void; - function it(name?: string, fn?: ItFn): void; - function it(options?: TestOptions, fn?: ItFn): void; - function it(fn?: ItFn): void; + function it(name?: string, options?: TestOptions, fn?: TestFn): void; + function it(name?: string, fn?: TestFn): void; + function it(options?: TestOptions, fn?: TestFn): void; + function it(fn?: TestFn): void; namespace it { // Shorthand for skipping a test, same as `it([name], { skip: true }[, fn])`. - function skip(name?: string, options?: TestOptions, fn?: ItFn): void; - function skip(name?: string, fn?: ItFn): void; - function skip(options?: TestOptions, fn?: ItFn): void; - function skip(fn?: ItFn): void; + function skip(name?: string, options?: TestOptions, fn?: TestFn): void; + function skip(name?: string, fn?: TestFn): void; + function skip(options?: TestOptions, fn?: TestFn): void; + function skip(fn?: TestFn): void; // Shorthand for marking a test as `TODO`, same as `it([name], { todo: true }[, fn])`. - function todo(name?: string, options?: TestOptions, fn?: ItFn): void; - function todo(name?: string, fn?: ItFn): void; - function todo(options?: TestOptions, fn?: ItFn): void; - function todo(fn?: ItFn): void; + function todo(name?: string, options?: TestOptions, fn?: TestFn): void; + function todo(name?: string, fn?: TestFn): void; + function todo(options?: TestOptions, fn?: TestFn): void; + function todo(fn?: TestFn): void; /** - * Shorthand for marking a suite as `TODO`, same as `it([name], { only: true }[, fn])`. + * Shorthand for marking a test as `only`, same as `it([name], { only: true }[, fn])`. + * @since v18.15.0 */ - function only(name?: string, options?: TestOptions, fn?: ItFn): void; - function only(name?: string, fn?: ItFn): void; - function only(options?: TestOptions, fn?: ItFn): void; - function only(fn?: ItFn): void; + function only(name?: string, options?: TestOptions, fn?: TestFn): void; + function only(name?: string, fn?: TestFn): void; + function only(options?: TestOptions, fn?: TestFn): void; + function only(fn?: TestFn): void; } + /** + * Shorthand for skipping a test, same as `test([name], { skip: true }[, fn])`. + * @since v20.2.0 + */ + function skip(name?: string, options?: TestOptions, fn?: TestFn): void; + function skip(name?: string, fn?: TestFn): void; + function skip(options?: TestOptions, fn?: TestFn): void; + function skip(fn?: TestFn): void; + /** + * Shorthand for marking a test as `TODO`, same as `test([name], { todo: true }[, fn])`. + * @since v20.2.0 + */ + function todo(name?: string, options?: TestOptions, fn?: TestFn): void; + function todo(name?: string, fn?: TestFn): void; + function todo(options?: TestOptions, fn?: TestFn): void; + function todo(fn?: TestFn): void; + /** + * Shorthand for marking a test as `only`, same as `test([name], { only: true }[, fn])`. + * @since v20.2.0 + */ + function only(name?: string, options?: TestOptions, fn?: TestFn): void; + function only(name?: string, fn?: TestFn): void; + function only(options?: TestOptions, fn?: TestFn): void; + function only(fn?: TestFn): void; /** * The type of a function under test. The first argument to this function is a * {@link TestContext} object. If the test uses callbacks, the callback function is passed as @@ -235,11 +255,6 @@ declare module 'node:test' { * If the test uses callbacks, the callback function is passed as an argument */ type SuiteFn = (done: (result?: any) => void) => void; - /** - * The type of a function under test. - * If the test uses callbacks, the callback function is passed as an argument - */ - type ItFn = (done: (result?: any) => void) => any; interface RunOptions { /** * If a number is provided, then that many files would run in parallel. @@ -1030,5 +1045,5 @@ declare module 'node:test' { */ restore(): void; } - export { test as default, run, test, describe, it, before, after, beforeEach, afterEach, mock }; + export { test as default, run, test, describe, it, before, after, beforeEach, afterEach, mock, skip, only, todo }; } diff --git a/types/node/ts4.8/test/test.ts b/types/node/ts4.8/test/test.ts index f0249511edeae4..20f44fb9953625 100644 --- a/types/node/ts4.8/test/test.ts +++ b/types/node/ts4.8/test/test.ts @@ -1,4 +1,4 @@ -import { describe, it, run, test, before, beforeEach, after, afterEach } from 'node:test'; +import { describe, it, run, test, before, beforeEach, after, afterEach, skip, only, todo } from 'node:test'; // run without options // $ExpectType TestsStream @@ -98,6 +98,24 @@ test(t => { // @ts-expect-error test(1, () => {}); +test.after(() => {}); +test.afterEach(() => {}); +test.before(() => {}); +test.beforeEach(() => {}); +test.describe('describe', () => {}); +test.it('it', () => {}); +// $ExpectType MockTracker +test.mock; +// $ExpectType typeof test +test.test; +test.test.test('chained self ref', (t) => { + // $ExpectType typeof test + t.test; +}); +test.skip('skip', () => {}); +test.todo('todo', () => {}); +test.only('only', () => {}); + describe('foo', () => { it('it', () => {}); }); @@ -132,26 +150,99 @@ it('options with booleans', { todo: false, }); +skip('skip shorthand', { + concurrency: 1, + skip: true, + signal: new AbortController().signal, + timeout: Infinity, +}); +skip((t, cb) => { + // $ExpectType TestContext + t; + // $ExpectType (result?: any) => void + cb; + // $ExpectType void + cb({ x: 'anything' }); +}); +test.skip('skip shorthand', { + concurrency: 1, + skip: true, + signal: new AbortController().signal, + timeout: Infinity, +}); describe.skip('skip shorthand', { + concurrency: 1, + skip: true, + signal: new AbortController().signal, + timeout: Infinity, +}); +it.skip('skip shorthand', { + concurrency: 1, + skip: true, + signal: new AbortController().signal, + timeout: Infinity, +}); + +todo('todo shorthand', { + concurrency: 1, + todo: true, + signal: new AbortController().signal, + timeout: Infinity, +}); +todo((t, cb) => { + // $ExpectType TestContext + t; + // $ExpectType (result?: any) => void + cb; + // $ExpectType void + cb({ x: 'anything' }); +}); +test.todo('todo shorthand', { + concurrency: 1, + todo: true, + signal: new AbortController().signal, + timeout: Infinity, +}); +describe.todo('todo shorthand', { + concurrency: 1, + todo: true, + signal: new AbortController().signal, + timeout: Infinity, +}); +it.todo('todo shorthand', { + concurrency: 1, + todo: true, + signal: new AbortController().signal, + timeout: Infinity, +}); + +only('todo shorthand', { concurrency: 1, only: true, signal: new AbortController().signal, timeout: Infinity, }); -it.skip('todo shorthand', { +only((t, cb) => { + // $ExpectType TestContext + t; + // $ExpectType (result?: any) => void + cb; + // $ExpectType void + cb({ x: 'anything' }); +}); +test.only('only shorthand', { concurrency: 1, only: true, signal: new AbortController().signal, timeout: Infinity, }); - -describe.todo('skip shorthand', { +describe.only('only shorthand', { concurrency: 1, only: true, signal: new AbortController().signal, timeout: Infinity, }); -it.todo('todo shorthand', { +it.only('only shorthand', { concurrency: 1, only: true, signal: new AbortController().signal, @@ -167,7 +258,9 @@ describe(cb => { }); // Test callback mode -it(cb => { +it((t, cb) => { + // $ExpectType TestContext + t; // $ExpectType (result?: any) => void cb; // $ExpectType void diff --git a/types/node/v18/test.d.ts b/types/node/v18/test.d.ts index 0196cbc10f72fc..135569f2a292e2 100644 --- a/types/node/v18/test.d.ts +++ b/types/node/v18/test.d.ts @@ -10,7 +10,6 @@ declare module 'node:test' { * @returns A {@link TestsStream} that emits events about the test execution. */ function run(options?: RunOptions): TestsStream; - /** * The `test()` function is the value imported from the test module. Each invocation of this * function results in reporting the test to the {@link TestsStream}. @@ -49,7 +48,19 @@ declare module 'node:test' { function test(name?: string, options?: TestOptions, fn?: TestFn): Promise; function test(options?: TestOptions, fn?: TestFn): Promise; function test(fn?: TestFn): Promise; - + namespace test { + export { + after, + afterEach, + before, + beforeEach, + describe, + it, + run, + mock, + test + }; + } /** * @since v18.6.0 * @param name The name of the suite, which is displayed when reporting suite results. @@ -73,6 +84,15 @@ declare module 'node:test' { function todo(name?: string, fn?: SuiteFn): void; function todo(options?: TestOptions, fn?: SuiteFn): void; function todo(fn?: SuiteFn): void; + + /** + * Shorthand for marking a suite as `only`, same as `describe([name], { only: true }[, fn])`. + * @since v18.15.0 + */ + function only(name?: string, options?: TestOptions, fn?: SuiteFn): void; + function only(name?: string, fn?: SuiteFn): void; + function only(options?: TestOptions, fn?: SuiteFn): void; + function only(fn?: SuiteFn): void; } /** @@ -99,6 +119,15 @@ declare module 'node:test' { function todo(name?: string, fn?: TestFn): void; function todo(options?: TestOptions, fn?: TestFn): void; function todo(fn?: TestFn): void; + + /** + * Shorthand for marking a test as `only`, same as `it([name], { only: true }[, fn])`. + * @since v18.15.0 + */ + function only(name?: string, options?: TestOptions, fn?: TestFn): void; + function only(name?: string, fn?: TestFn): void; + function only(options?: TestOptions, fn?: TestFn): void; + function only(fn?: TestFn): void; } /** diff --git a/types/node/v18/test/test.ts b/types/node/v18/test/test.ts index 1c9cdf45004016..b58b6bb52ab3a4 100644 --- a/types/node/v18/test/test.ts +++ b/types/node/v18/test/test.ts @@ -95,6 +95,21 @@ test(t => { // @ts-expect-error test(1, () => {}); +test.after(() => {}); +test.afterEach(() => {}); +test.before(() => {}); +test.beforeEach(() => {}); +test.describe('describe', () => {}); +test.it('it', () => {}); +// $ExpectType MockTracker +test.mock; +// $ExpectType typeof test +test.test; +test.test.test('chained self ref', (t) => { + // $ExpectType typeof test + t.test; +}); + describe('foo', () => { it('it', () => {}); }); @@ -131,24 +146,37 @@ it('options with booleans', { describe.skip('skip shorthand', { concurrency: 1, - only: true, + skip: true, signal: new AbortController().signal, timeout: Infinity, }); -it.skip('todo shorthand', { +it.skip('skip shorthand', { concurrency: 1, - only: true, + skip: true, signal: new AbortController().signal, timeout: Infinity, }); -describe.todo('skip shorthand', { +describe.todo('todo shorthand', { concurrency: 1, - only: true, + todo: true, signal: new AbortController().signal, timeout: Infinity, }); it.todo('todo shorthand', { + concurrency: 1, + todo: true, + signal: new AbortController().signal, + timeout: Infinity, +}); + +describe.only('only shorthand', { + concurrency: 1, + only: true, + signal: new AbortController().signal, + timeout: Infinity, +}); +it.only('only shorthand', { concurrency: 1, only: true, signal: new AbortController().signal, diff --git a/types/node/v18/ts4.8/test.d.ts b/types/node/v18/ts4.8/test.d.ts index 0196cbc10f72fc..76c56a2edd820f 100644 --- a/types/node/v18/ts4.8/test.d.ts +++ b/types/node/v18/ts4.8/test.d.ts @@ -49,7 +49,19 @@ declare module 'node:test' { function test(name?: string, options?: TestOptions, fn?: TestFn): Promise; function test(options?: TestOptions, fn?: TestFn): Promise; function test(fn?: TestFn): Promise; - + namespace test { + export { + after, + afterEach, + before, + beforeEach, + describe, + it, + run, + mock, + test + }; + } /** * @since v18.6.0 * @param name The name of the suite, which is displayed when reporting suite results. @@ -73,6 +85,15 @@ declare module 'node:test' { function todo(name?: string, fn?: SuiteFn): void; function todo(options?: TestOptions, fn?: SuiteFn): void; function todo(fn?: SuiteFn): void; + + /** + * Shorthand for marking a suite as `only`, same as `describe([name], { only: true }[, fn])`. + * @since v18.15.0 + */ + function only(name?: string, options?: TestOptions, fn?: SuiteFn): void; + function only(name?: string, fn?: SuiteFn): void; + function only(options?: TestOptions, fn?: SuiteFn): void; + function only(fn?: SuiteFn): void; } /** @@ -99,6 +120,15 @@ declare module 'node:test' { function todo(name?: string, fn?: TestFn): void; function todo(options?: TestOptions, fn?: TestFn): void; function todo(fn?: TestFn): void; + + /** + * Shorthand for marking a test as `only`, same as `it([name], { only: true }[, fn])`. + * @since v18.15.0 + */ + function only(name?: string, options?: TestOptions, fn?: TestFn): void; + function only(name?: string, fn?: TestFn): void; + function only(options?: TestOptions, fn?: TestFn): void; + function only(fn?: TestFn): void; } /** diff --git a/types/node/v18/ts4.8/test/test.ts b/types/node/v18/ts4.8/test/test.ts index 1c9cdf45004016..b58b6bb52ab3a4 100644 --- a/types/node/v18/ts4.8/test/test.ts +++ b/types/node/v18/ts4.8/test/test.ts @@ -95,6 +95,21 @@ test(t => { // @ts-expect-error test(1, () => {}); +test.after(() => {}); +test.afterEach(() => {}); +test.before(() => {}); +test.beforeEach(() => {}); +test.describe('describe', () => {}); +test.it('it', () => {}); +// $ExpectType MockTracker +test.mock; +// $ExpectType typeof test +test.test; +test.test.test('chained self ref', (t) => { + // $ExpectType typeof test + t.test; +}); + describe('foo', () => { it('it', () => {}); }); @@ -131,24 +146,37 @@ it('options with booleans', { describe.skip('skip shorthand', { concurrency: 1, - only: true, + skip: true, signal: new AbortController().signal, timeout: Infinity, }); -it.skip('todo shorthand', { +it.skip('skip shorthand', { concurrency: 1, - only: true, + skip: true, signal: new AbortController().signal, timeout: Infinity, }); -describe.todo('skip shorthand', { +describe.todo('todo shorthand', { concurrency: 1, - only: true, + todo: true, signal: new AbortController().signal, timeout: Infinity, }); it.todo('todo shorthand', { + concurrency: 1, + todo: true, + signal: new AbortController().signal, + timeout: Infinity, +}); + +describe.only('only shorthand', { + concurrency: 1, + only: true, + signal: new AbortController().signal, + timeout: Infinity, +}); +it.only('only shorthand', { concurrency: 1, only: true, signal: new AbortController().signal,