Skip to content

Commit 9c39365

Browse files
committed
grammar and flow
1 parent e645b8b commit 9c39365

File tree

1 file changed

+7
-7
lines changed
  • exercises/02.vitest-browser-mode/05.problem.multiple-workspaces

1 file changed

+7
-7
lines changed

exercises/02.vitest-browser-mode/05.problem.multiple-workspaces/README.mdx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# Multiple workspaces
22

3-
The way you have Vitest configured right now will run _all tests_ using Browser Mode. This may not be what you want, especially if you are using Vitest for unit testing or integration testing in Node.js in the same project that needs in-browser component tests as well.
3+
Our current Vitest configuration runs _all tests_ in Browser Mode. This isn't ideal when you need to run different types of tests in the same project - like unit tests in Node.js alongside browser-based component tests.
44

5-
You can fix this by introducing _different workspaces_ for differnt types of tests. In fact, I think this is just the right task for you...
5+
You can fix this by introducing _different workspaces_ for different types of tests. In fact, I think this is just the right task for you...
66

7-
👨‍💼 In this one, you will expand on the Vitest configuration to support running multiple types of tests in the same project. This will be a multi-step process to make sure you have the Vitest and TypeScript configured correctly for your tests.
7+
👨‍💼 In this one, you will expand the Vitest configuration to support running multiple types of tests in the same project. This will be a multi-step process to make sure you have Vitest and TypeScript configured correctly for your tests.
88

9-
🐨 First, update <InlineFile file="vite.config.ts">`vite.config.ts`</InlineFile> to list multiple [workspaces](https://main.vitest.dev/guide/workspace.html#configuration). Define one for unit tests and the other for component tests.
9+
🐨 First, update <InlineFile file="vite.config.ts">`vite.config.ts`</InlineFile> to list multiple [workspaces](https://main.vitest.dev/guide/workspace.html#configuration). Define one for unit tests and another for component tests.
1010

11-
🐨 Next, rename <InlineFile file="tsconfig.test.json">`tsconfig.test.json`</InlineFile> to `tsconfig.test.browser.json`. This TypeScript configuration will apply only to the component tests now. Update its `include` to target `**/*.browser.test.ts*` files:
11+
🐨 Next, rename <InlineFile file="tsconfig.test.json">`tsconfig.test.json`</InlineFile> to `tsconfig.test.browser.json`. This TypeScript configuration will only apply to the component tests now. Update its `include` setting to target `**/*.browser.test.ts*` files:
1212

1313
```json filename=tsconfig.test.browser.json remove=2 add=3
1414
{
@@ -17,7 +17,7 @@ You can fix this by introducing _different workspaces_ for differnt types of tes
1717
}
1818
```
1919

20-
🐨 To have proper type-checking in unit tests, create a new <InlineFile file="tsconfig.test.unit.json">`tsconfig.test.unit.json`</InlineFile> file and list there the properties necessary for the unit tests. You can use this as an example:
20+
🐨 To have proper type-checking in unit tests, create a new <InlineFile file="tsconfig.test.unit.json">`tsconfig.test.unit.json`</InlineFile> file and add the necessary properties for unit tests. You can use this as an example:
2121

2222
```json filename=tsconfig.test.unit.json
2323
{
@@ -49,6 +49,6 @@ You can fix this by introducing _different workspaces_ for differnt types of tes
4949
}
5050
```
5151

52-
🐨 Finally, rename the existing `file-preview.test.tsx` component test to `file-preview.browser.test.tsx` to be picked up by the proper workspace in Vitest.
52+
🐨 Finally, rename the existing `file-preview.test.tsx` component test to `file-preview.browser.test.tsx` to be included in the correct Vitest workspace.
5353

5454
See you on the other side once you're done to go through each step in more detail.

0 commit comments

Comments
 (0)