Skip to content
Compare
Choose a tag to compare
@github-actions github-actions released this 27 Apr 14:52
· 6 commits to main since this release
5016aab

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);
```