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

Co-authored-by: Vladimir <[email protected]>
This commit is contained in:
Allison Pratt
2023-10-27 16:41:27 +02:00
committed by GitHub
co-authored by Vladimir
parent 823932de4f
commit 94e56b126a
3 changed files with 20 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
export const squared = (n: number) => n * n
+6
View File
@@ -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',
+13
View File
@@ -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"]
}