Skip to content

Commit 196d645

Browse files
committed
Set up configuration for tests
1 parent 4726887 commit 196d645

File tree

6 files changed

+59
-13
lines changed

6 files changed

+59
-13
lines changed

package-lock.json

Lines changed: 18 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"@matt.kantor/either": "^1.0.0"
66
},
77
"devDependencies": {
8+
"@types/node": "^22.13.14",
89
"typescript": "^5.7.3"
910
},
1011
"files": [
@@ -14,8 +15,10 @@
1415
"main": "dist/index.js",
1516
"repository": "github:mkantor/parsing",
1617
"scripts": {
17-
"clean": "rm -rf dist *.tsbuildinfo",
18-
"build": "tsc --build"
18+
"clean": "rm -rf dist* *.tsbuildinfo",
19+
"build": "tsc --build tsconfig.lib.json",
20+
"build:tests": "tsc --project tsconfig.lib.json --outDir dist-test --declarationDir dist && tsc --build tsconfig.test.json",
21+
"test": "npm run build:tests && node --test"
1922
},
2023
"type": "module"
2124
}

tsconfig.base.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"compilerOptions": {
3+
"composite": true,
4+
"exactOptionalPropertyTypes": true,
5+
"module": "node16",
6+
"noPropertyAccessFromIndexSignature": true,
7+
"noUncheckedIndexedAccess": true,
8+
"noUncheckedSideEffectImports": true,
9+
"rootDir": "./src",
10+
"skipLibCheck": true,
11+
"strict": true,
12+
"target": "es2022",
13+
"verbatimModuleSyntax": true
14+
}
15+
}

tsconfig.json

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
{
2-
"compilerOptions": {
3-
"declaration": true,
4-
"exactOptionalPropertyTypes": true,
5-
"module": "node16",
6-
"noUncheckedIndexedAccess": true,
7-
"outDir": "dist",
8-
"rootDir": "src",
9-
"strict": true,
10-
"target": "es2020",
11-
"verbatimModuleSyntax": true
12-
}
2+
"references": [
3+
{ "path": "./tsconfig.test.json" },
4+
{ "path": "./tsconfig.lib.json" }
5+
]
136
}

tsconfig.lib.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"extends": "./tsconfig.base.json",
3+
"compilerOptions": {
4+
"types": [],
5+
"outDir": "./dist"
6+
},
7+
"include": ["./src/**/*.ts"],
8+
"exclude": ["./src/**/*.test.ts"]
9+
}

tsconfig.test.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": "./tsconfig.base.json",
3+
"compilerOptions": {
4+
"outDir": "./dist-test"
5+
},
6+
"include": ["./src/**/*.test.ts"],
7+
"references": [{ "path": "./tsconfig.lib.json" }]
8+
}

0 commit comments

Comments
 (0)