Skip to content

Releases: ssssota/doc-vitest

vite-plugin-doctest@2.0.0

22 Mar 10:57
c588176

Choose a tag to compare

Major Changes

  • #134 f2ea9a3 Thanks @mspiess! - Update minimum version of peer dependencies vite and vitest

    Vite >=6 and Vitest >=4 are now required.

vite-plugin-doctest@1.2.2

13 Mar 02:37
3f2a788

Choose a tag to compare

Patch Changes

vite-plugin-doctest@1.2.1

01 Mar 03:03

Choose a tag to compare

Patch Changes

  • #124 d0c8b3b Thanks @mspiess! - Do not include "@import.meta.vitest" in the Markdown test name

  • #121 1c2a37e Thanks @mspiess! - Fix code generation when markdown file would end on a closing code fence without line break afterward

vite-plugin-doctest@1.1.1

29 Oct 14:45
1eeb18f

Choose a tag to compare

Patch Changes

vite-plugin-doctest@1.1.0

28 Oct 16:23
434b943

Choose a tag to compare

Minor Changes

vite-plugin-doctest@1.0.0

27 Apr 14:52
5016aab

Choose a tag to compare

Major Changes

MIGRATION GUIDE

TypeScript/JavaScript

You should use the @example tag to specify the test code, and put the @import.meta.vitest marker after the language specifier.
This is a more natural way to specify the example code.

V0
/**
 * @import.meta.vitest
 * ```ts
 * expect(add(1, 2)).toBe(3);
 * ```
 */
const add = (a: number, b: number) => a + b;

V1

/**
 * @example
 * ```ts @import.meta.vitest
 * expect(add(1, 2)).toBe(3);
 * ```
 */
const add = (a: number, b: number) => a + b;
Markdown

You should put the @import.meta.vitest marker after the language specifier.

V0
<!-- @import.meta.vitest -->
```ts
const { add } = await import('./add');
expect(add(1, 2)).toBe(3);
```

V1

```ts @import.meta.vitest
const { add } = await import('./add');
expect(add(1, 2)).toBe(3);
```

vite-plugin-doctest@0.1.3

07 Mar 07:13
31d9901

Choose a tag to compare

Patch Changes

vite-plugin-doctest@0.1.2

05 Dec 15:05
d236d2f

Choose a tag to compare

Patch Changes

vite-plugin-doctest@0.1.1

14 Sep 10:50
ad0f0c0

Choose a tag to compare

Patch Changes