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
Now that we've installed the necessary packages, we'll need to configure vitest to work with Solid. Let's create a `vitest.config.ts` file in the root of our project.
31
31
32
32
```ts
33
-
/// <referencetypes="vitest" />
34
-
/// <referencetypes="vite/client" />
35
-
// 👆 do not forget to add the references above
36
-
37
33
import { defineConfig } from'vite';
38
34
importsolidPluginfrom'vite-plugin-solid';
39
35
@@ -48,7 +44,7 @@ export default defineConfig({
48
44
test:{
49
45
environment: 'jsdom',
50
46
globals: true,
51
-
transformMode: { web: [/\.[jt]sx?$/] },
47
+
testTransformMode: { web: ["/\.[jt]sx?$/"] },
52
48
}
53
49
});
54
50
```
@@ -98,7 +94,7 @@ In Solid we recommend creating a `test` folder to house all your test files in.
98
94
99
95
```bash
100
96
mkdir test
101
-
touch test/App.test.ts
97
+
touch test/App.test.tsx
102
98
```
103
99
104
100
Now that we've created the test file, let's add some tests.
@@ -145,8 +141,8 @@ Let's create a test file for our `Counter` component:
0 commit comments