Skip to content

Commit

Permalink
Uses separate tsconfig for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
allanlasser committed Feb 23, 2024
1 parent 3469743 commit 942f518
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default {
testEnvironment: "jsdom",
transform: {
"^.+\\.svelte$": ["svelte-jester", { preprocess: true }],
"^.+\\.ts$": ["ts-jest", { useESM: true }],
"^.+\\.ts$": ["ts-jest", { useESM: true, tsconfig: "tsconfig.test.json" }],
},
transformIgnorePatterns: ["/node_modules/(?!svue).+\\.js$"],
collectCoverageFrom: ["./**/*.{js,ts,svelte}"],
Expand Down
1 change: 0 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"svelte": ["node_modules/svelte"]
},
"downlevelIteration": true,
"moduleResolution": "nodenext",
"types": ["@testing-library/jest-dom"]
},
"include": ["src/**/*.ts", "src/**/*.svelte", "src/**/*.js"],
Expand Down
22 changes: 22 additions & 0 deletions tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
// "extends": "@tsconfig/svelte/tsconfig.json" /* all options: https://www.typescriptlang.org/tsconfig#resolveJsonModule */,
"compilerOptions": {
// "ignoreDeprecations": "5.0",
// "verbatimModuleSyntax": true,
"allowSyntheticDefaultImports": true,
"resolveJsonModule": true,
"lib": ["es2020", "DOM", "dom.iterable"],
"allowJs": true,
// "checkJs": true, /* 600+ errors */
"baseUrl": "/app",
"paths": {
"@/*": ["src/*"],
"svelte": ["node_modules/svelte"]
},
"downlevelIteration": true,
"moduleResolution": "nodenext",
"types": ["@testing-library/jest-dom"]
},
"include": ["src/**/*.ts", "src/**/*.svelte", "src/**/*.js"],
"exclude": ["public/*"]
}

0 comments on commit 942f518

Please sign in to comment.