mirror of
https://github.com/hanzoai/vitest.git
synced 2026-09-24 17:04:25 +00:00
chore: add tsconfig.json to basic example (#4372)
Co-authored-by: Vladimir <[email protected]>
This commit is contained in:
committed by
GitHub
co-authored by
Vladimir
parent
823932de4f
commit
94e56b126a
@@ -0,0 +1 @@
|
||||
export const squared = (n: number) => n * n
|
||||
@@ -1,4 +1,5 @@
|
||||
import { assert, expect, test } from 'vitest'
|
||||
import { squared } from '../src/basic.js'
|
||||
|
||||
// Edit an assertion and save to see HMR in action
|
||||
|
||||
@@ -8,6 +9,11 @@ test('Math.sqrt()', () => {
|
||||
expect(Math.sqrt(2)).toBe(Math.SQRT2)
|
||||
})
|
||||
|
||||
test('Squared', () => {
|
||||
expect(squared(2)).toBe(4)
|
||||
expect(squared(12)).toBe(144)
|
||||
})
|
||||
|
||||
test('JSON', () => {
|
||||
const input = {
|
||||
foo: 'hello',
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "node16",
|
||||
"target": "es2020",
|
||||
"strict": true,
|
||||
"verbatimModuleSyntax": true,
|
||||
"declaration": true,
|
||||
"sourceMap": true,
|
||||
"declarationMap": true
|
||||
},
|
||||
"include": ["src", "test"],
|
||||
"exclude": ["node_modules"]
|
||||
}
|
||||
Reference in New Issue
Block a user