Skip to content

Commit

Permalink
chore: add tsconfig.json to basic example (#4372)
Browse files Browse the repository at this point in the history
Co-authored-by: Vladimir <sleuths.slews0s@icloud.com>
  • Loading branch information
allisons11 and sheremet-va committed Oct 27, 2023
1 parent 1108227 commit b3bc866
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions examples/basic/src/basic.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const squared = (n: number) => n * n
6 changes: 6 additions & 0 deletions examples/basic/test/basic.test.ts
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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',
Expand Down
13 changes: 13 additions & 0 deletions examples/basic/tsconfig.json
Original file line number Diff line number Diff line change
@@ -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"]
}

0 comments on commit b3bc866

Please sign in to comment.