diff --git a/expect/fn.ts b/expect/fn.ts index f57a04ed2..c9d16c3b7 100644 --- a/expect/fn.ts +++ b/expect/fn.ts @@ -4,8 +4,6 @@ // deno-lint-ignore-file no-explicit-any ban-types /** - * @module - * * This module contains a function to mock functions for testing and assertions. * * ```ts @@ -19,6 +17,8 @@ * expect(mockFn).toHaveBeenCalledTimes(1); * }); * ``` + * + * @module */ import { MOCK_SYMBOL, type MockCall } from "./_mock_util.ts"; @@ -26,7 +26,7 @@ import { MOCK_SYMBOL, type MockCall } from "./_mock_util.ts"; /** * Creates a mock function that can be used for testing and assertions. * - * @param stubs - functions to be used as stubs for different calls. + * @param stubs Functions to be used as stubs for different calls. * @returns A mock function that keeps track of calls and returns values based on the provided stubs. * * @example Usage diff --git a/expect/mod.ts b/expect/mod.ts index 337619507..c723ff97c 100644 --- a/expect/mod.ts +++ b/expect/mod.ts @@ -5,6 +5,16 @@ /** * This module provides Jest compatible expect assertion functionality. * + * ```ts no-assert + * import { expect } from "@std/expect"; + * + * const x = 6 * 7; + * expect(x).toEqual(42); + * expect(x).not.toEqual(0); + * + * await expect(Promise.resolve(x)).resolves.toEqual(42); + * ``` + * * Currently this module supports the following functions: * - Common matchers: * - `toBe` @@ -69,21 +79,14 @@ * - `expect.hasAssertions` * - `expect.addSnapshotSerializer` * + * The tracking issue to add support for unsupported parts of the API is + * {@link https://github.com/denoland/std/issues/3964}. + * * This module is largely inspired by - * {@link https://github.com/allain/expect | x/expect} module by Allain Lalonde. - * - * ```ts no-assert - * import { expect } from "@std/expect"; - * - * const x = 6 * 7; - * expect(x).toEqual(42); - * expect(x).not.toEqual(0); - * - * await expect(Promise.resolve(x)).resolves.toEqual(42); - * ``` + * {@link https://github.com/allain/expect | x/expect} module by + * {@link https://github.com/allain | Allain Lalonde}. * * @module */ -export { expect } from "./expect.ts"; -export type { AnyConstructor, Async, Expected } from "./expect.ts"; -export { fn } from "./fn.ts"; +export * from "./expect.ts"; +export * from "./fn.ts";