Slide 6
Slide 6 text
仕組み(変換)
/**
* @import.meta.vitest
* ```ts:1+2=3
* expect(add(1, 2)).toBe(3);
* ```
*/
export function add(a: number, b: number) {
return a + b;
}
/**
* @import.meta.vitest
* ```ts:1+2=3
* expect(add(1, 2)).toBe(3);
* ```
*/
export function add(a: number, b: number) {
return a + b;
}
if (import.meta.vitest) {
const {assert,...} = import.meta.vitest;
import.meta.vitest.test("1+2=3", async()=>{
expect(add(1, 2)).toBe(3);
});
}