[READ-ONLY] Mirror of https://github.com/vitest-dev/vitest. Next generation testing framework powered by Vite. vitest.dev
test testing-tools vite
12

Configure Feed

Select the types of activity you want to include in your feed.

chore: add tsconfig.json to basic example (#4372)

Co-authored-by: Vladimir <sleuths.slews0s@icloud.com>

authored by

Allison Pratt
Vladimir
and committed by
GitHub
(Oct 27, 2023, 4:41 PM +0200) b3bc866d 11082275

+20
+13
examples/basic/tsconfig.json
··· 1 + { 2 + "compilerOptions": { 3 + "module": "node16", 4 + "target": "es2020", 5 + "strict": true, 6 + "verbatimModuleSyntax": true, 7 + "declaration": true, 8 + "sourceMap": true, 9 + "declarationMap": true 10 + }, 11 + "include": ["src", "test"], 12 + "exclude": ["node_modules"] 13 + }
+1
examples/basic/src/basic.ts
··· 1 + export const squared = (n: number) => n * n
+6
examples/basic/test/basic.test.ts
··· 1 1 import { assert, expect, test } from 'vitest' 2 + import { squared } from '../src/basic.js' 2 3 3 4 // Edit an assertion and save to see HMR in action 4 5 ··· 6 7 expect(Math.sqrt(4)).toBe(2) 7 8 expect(Math.sqrt(144)).toBe(12) 8 9 expect(Math.sqrt(2)).toBe(Math.SQRT2) 10 + }) 11 + 12 + test('Squared', () => { 13 + expect(squared(2)).toBe(4) 14 + expect(squared(12)).toBe(144) 9 15 }) 10 16 11 17 test('JSON', () => {