Skip to content

Commit

Permalink
Update headless tests. Update field names.
Browse files Browse the repository at this point in the history
  • Loading branch information
infomiho committed Sep 20, 2024
1 parent f1245ba commit b2594ce
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
23 changes: 15 additions & 8 deletions waspc/headless-test/examples/todoApp/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
// compiler. Proper TS compiler configuration in Wasp is coming soon :)
{
"compilerOptions": {
"module": "esnext",
"target": "esnext",
// We're bundling all code in the end so this is the most appropriate option,
// it's also important for autocomplete to work properly.
"moduleResolution": "bundler",
// JSX support
"jsx": "preserve",
"strict": true,
Expand All @@ -16,19 +21,21 @@
"esnext"
],
"allowJs": true,
"types": [
"typeRoots": [
// This is needed to properly support Vitest testing with jest-dom matchers.
// Types for jest-dom are not recognized automatically and Typescript complains
// about missing types e.g. when using `toBeInTheDocument` and other matchers.
"@testing-library/jest-dom"
"node_modules/@testing-library",
// Specifying type roots overrides the default behavior of looking at the
// node_modules/@types folder so we had to list it explicitly.
// Source 1: https://www.typescriptlang.org/tsconfig#typeRoots
// Source 2: https://github.com/testing-library/jest-dom/issues/546#issuecomment-1889884843
"node_modules/@types"
],
// Since this TS config is used only for IDE support and not for
// compilation, the following directory doesn't exist. We need to specify
// it to prevent this error:
// https://stackoverflow.com/questions/42609768/typescript-error-cannot-write-file-because-it-would-overwrite-input-file
"outDir": "phantom",
},
"exclude": [
"phantom"
],
}
"outDir": ".wasp/phantom"
}
}
2 changes: 1 addition & 1 deletion waspc/src/Wasp/ExternalConfig/TsConfig.hs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ validateTsConfig tsConfig =
]

validateRequiredFieldInCompilerOptions fieldName expectedValue getField =
validateRequiredField fieldName expectedValue $ getField compilerOptionsFields
validateRequiredField ("compilerOptions." ++ fieldName) expectedValue $ getField compilerOptionsFields

compilerOptionsFields = compilerOptions tsConfig

Expand Down

0 comments on commit b2594ce

Please sign in to comment.