Skip to content

Commit d987a67

Browse files
committed
02/04: fix problem/solution descriptions
1 parent 9bfe1c4 commit d987a67

File tree

2 files changed

+11
-7
lines changed
  • exercises/02.vitest-browser-mode

2 files changed

+11
-7
lines changed

exercises/02.vitest-browser-mode/04.problem.shared-assets/README.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ I think this is a great problem for you to fix!
1818

1919
🐨 First, create a <InlineFile file="vitest.browser.setup.ts">`vitest.browser.setup.ts`</InlineFile> file. In that file, import any assets you wish to apply to _all tests_ (e.g. `./src/index.css`).
2020

21-
🐨 Enable TypeScript for the new file by adding it to the `include` array in <InlineFile file="tsconfig.node.json">`tsconfig.node.json`</InlineFile>.
21+
🐨 Enable TypeScript for the new file by adding it to the `include` array in <InlineFile file="tsconfig.test.json">`tsconfig.test.json`</InlineFile>.
2222

2323
Once you do all this, you will spot that the `*.css` imports fail to resolve in TypeScript.
2424

exercises/02.vitest-browser-mode/04.solution.shared-assets/README.mdx

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,18 @@ import './src/index.css'
1919

2020
Since we added this new file, we have to tell TypeScript how it should be handled. In `tsconfig.test.json`, add `vitest.browser.setup.ts` to the `compilerOptions.include` array:
2121

22-
```json filename=tsconfig.test.json add=6
22+
```json filename=tsconfig.test.json add=5
2323
{
24+
"extends": "./tsconfig.app.json",
25+
"include": [
26+
// The setup file runs in the browser just like the test suite.
27+
"vitest.browser.setup.ts",
28+
"src/**/*",
29+
"src/**/*.test.ts*"
30+
],
31+
"exclude": [],
2432
"compilerOptions": {
25-
"include": [
26-
"**/*.test.ts*",
27-
// The setup file runs in the browser just like the test suite.
28-
"vitest.browser.setup.ts"
29-
]
33+
"types": ["vitest/globals", "@vitest/browser/providers/playwright"]
3034
}
3135
}
3236
```

0 commit comments

Comments
 (0)