Releases: ssssota/doc-vitest
Releases · ssssota/doc-vitest
[email protected]
[email protected]
[email protected]
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);
```