You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
plugins: [swc.vite()], // This is required to build the test files with SWC
126
125
});
127
126
```
128
127
129
-
This configuration file sets up the Vitest environment with the necessary aliases, root directory, and SWC plugin. You should also create a separate configuration
130
-
file for e2e tests, with an additional field `include` that specifies the test path regex:
128
+
This configuration file sets up the Vitest environment, root directory, and SWC plugin. You should also create a separate configuration
129
+
file for e2e tests, with an additional `include` field that specifies the test path regex:
131
130
132
131
```ts
133
132
importswcfrom'unplugin-swc';
@@ -143,7 +142,7 @@ export default defineConfig({
143
142
});
144
143
```
145
144
146
-
Additionaly, you can set the `alias` options to support typescript paths in your tests:
145
+
Additionally, you can set the `alias` options to support TypeScript paths in your tests:
147
146
148
147
```ts
149
148
importswcfrom'unplugin-swc';
@@ -171,7 +170,7 @@ export default defineConfig({
171
170
172
171
#### Update imports in E2E tests
173
172
174
-
Change any E2E test imports using `import * as request from 'supertest'` to `import request from 'supertest';`. This is necessary because Vitest, when bundled with Vite, expects a default import for supertest. Using a namespace import may cause issues in this specific setup.
173
+
Change any E2E test imports using `import * as request from 'supertest'` to `import request from 'supertest'`. This is necessary because Vitest, when bundled with Vite, expects a default import for supertest. Using a namespace import may cause issues in this specific setup.
175
174
176
175
Lastly, update the test scripts in your package.json file to the following:
0 commit comments