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
@@ -126,47 +126,47 @@ To enable TypeScript support you'll need to setup [`svelte-preprocess`](https://
126
126
127
127
1. Create a `svelte.config.js` at the root of your project:
128
128
129
-
```js
130
-
importpreprocessfrom'svelte-preprocess'
129
+
```js
130
+
importpreprocessfrom'svelte-preprocess'
131
131
132
-
/**@type{import('@sveltejs/kit').Config}*/
133
-
exportdefaultconfig= {
134
-
preprocess:preprocess(),
135
-
// ...
136
-
};
137
-
```
132
+
/**@type{import('@sveltejs/kit').Config}*/
133
+
exportdefaultconfig= {
134
+
preprocess:preprocess(),
135
+
// ...
136
+
};
137
+
```
138
138
139
139
To learn what options you can pass to `sveltePreprocess`, please refer to the [documentation](https://github.com/sveltejs/svelte-preprocess/blob/main/docs/preprocessing.md#typescript).
140
140
141
141
1. In your Jest config, enable preprocessing for `svelte-jester`, and add `ts-jest` as a transform:
142
142
143
-
```json
144
-
"transform": {
145
-
"^.+\\.svelte$": [
146
-
"svelte-jester",
147
-
{
148
-
"preprocess": true
149
-
}
150
-
],
151
-
"^.+\\.ts$": [
152
-
"ts-jest",
153
-
{
154
-
"useESM": true
155
-
// optional: seperate tsconfig for tests
156
-
//"tsconfig": "tsconfig.spec.json",
157
-
}
158
-
],
159
-
},
160
-
"moduleFileExtensions": [
161
-
"js",
162
-
"ts",
163
-
"svelte"
164
-
],
165
-
"extensionsToTreatAsEsm": [
166
-
".svelte",
167
-
".ts"
168
-
],
169
-
```
143
+
```json
144
+
"transform": {
145
+
"^.+\\.svelte$": [
146
+
"svelte-jester",
147
+
{
148
+
"preprocess": true
149
+
}
150
+
],
151
+
"^.+\\.ts$": [
152
+
"ts-jest",
153
+
{
154
+
"useESM": true
155
+
// optional: seperate tsconfig for tests
156
+
//"tsconfig": "tsconfig.spec.json",
157
+
}
158
+
],
159
+
},
160
+
"moduleFileExtensions": [
161
+
"js",
162
+
"ts",
163
+
"svelte"
164
+
],
165
+
"extensionsToTreatAsEsm": [
166
+
".svelte",
167
+
".ts"
168
+
],
169
+
```
170
170
171
171
However if you do not want to create a `svelte.config.js` at the root of your
172
172
project or you wish to use a custom config just for tests, you may pass the
@@ -218,22 +218,22 @@ path to the config file to the `preprocess` option thus:
218
218
219
219
1. In your Jest config, enable preprocessing for `svelte-jester`, and add `ts-jest` as a transform:
0 commit comments