Skip to content

Commit

Permalink
build: Separate tsconfig for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
NiGhTTraX committed Dec 12, 2024
1 parent 8370201 commit 92879d9
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 38 deletions.
4 changes: 1 addition & 3 deletions tests/jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { createDefaultPreset, type JestConfigWithTsJest } from 'ts-jest';

const presetConfig = createDefaultPreset({
tsconfig: {
target: 'ESNext',
},
tsconfig: './tsconfig.test.json',
});

const jestConfig: JestConfigWithTsJest = {
Expand Down
26 changes: 26 additions & 0 deletions tsconfig.app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"compilerOptions": {
"module": "NodeNext",
"moduleResolution": "NodeNext",

"target": "ES6",
"downlevelIteration": true,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,

"types": [],
"lib": ["ES6", "ES2019"],
"skipLibCheck": true,

"strict": true,
"noUnusedParameters": false,
"noUnusedLocals": false
},
"include": ["src"],
"exclude": [
"**/*.spec.ts",
"**/*.test.ts",
"**/*.contract.ts",
"**/*.mocks.ts"
]
}
18 changes: 3 additions & 15 deletions tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,9 @@
{
"extends": "./tsconfig.json",
"extends": "./tsconfig.app.json",

"compilerOptions": {
"declaration": true,
"declarationDir": "./dist",
"outDir": "./dist",
"module": "ESNext",
"target": "ESNext"
},
"include": [
"src/**/*"
],
"exclude": [
"dist",
"**/*.spec.ts",
"**/*.test.ts",
"**/*.contract.ts",
"**/*.mocks.ts"
]
"outDir": "./dist"
}
}
24 changes: 4 additions & 20 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,7 @@
{
"compilerOptions": {
"module": "NodeNext",
"moduleResolution": "NodeNext",

"target": "ES6",
"downlevelIteration": true,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,

"types": ["jest", "node"],
"lib": ["ES6"],
"skipLibCheck": true,

"strict": true,
"noUnusedParameters": false,
"noUnusedLocals": false,
},
"exclude": [
"node_modules",
"dist"
"files": [],
"references": [
{ "path": "./tsconfig.app.json" },
{ "path": "./tsconfig.test.json" }
]
}
11 changes: 11 additions & 0 deletions tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": ["./tsconfig.app.json"],
"compilerOptions": {
"types": ["jest", "node"]
},
"include": [
"**/*.spec.ts",
"tests"
],
"exclude": []
}

0 comments on commit 92879d9

Please sign in to comment.