Skip to content

Commit 9b24b9c

Browse files
dummdidummbenmccannRich-Harrisdominikg
authored
[fix] add test folder to includes (#6085)
* [fix] add test folder to includes Also add some notes to tsconfig/jsonfig Fixes #5833 * Update packages/create-svelte/shared/+typescript/tsconfig.json Co-authored-by: Ben McCann <[email protected]> * Update packages/kit/src/core/sync/write_tsconfig.js Co-authored-by: Dominik G. <[email protected]> Co-authored-by: Ben McCann <[email protected]> Co-authored-by: Rich Harris <[email protected]> Co-authored-by: Dominik G. <[email protected]>
1 parent 692daed commit 9b24b9c

File tree

5 files changed

+24
-0
lines changed

5 files changed

+24
-0
lines changed

.changeset/hot-lions-cough.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'create-svelte': patch
3+
---
4+
5+
Add notes about includes/excludes and path aliases

.changeset/warm-pots-melt.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@sveltejs/kit': patch
3+
---
4+
5+
Add test folder to generated tsconfig

packages/create-svelte/shared/+checkjs/jsconfig.json

+4
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,8 @@
1010
"sourceMap": true,
1111
"strict": true
1212
}
13+
// Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias and https://kit.svelte.dev/docs/configuration#files
14+
//
15+
// If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes
16+
// from the referenced tsconfig.json - TypeScript does not merge them in
1317
}

packages/create-svelte/shared/+typescript/tsconfig.json

+4
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,8 @@
1010
"sourceMap": true,
1111
"strict": true
1212
}
13+
// Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias
14+
//
15+
// If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes
16+
// from the referenced tsconfig.json - TypeScript does not merge them in
1317
}

packages/kit/src/core/sync/write_tsconfig.js

+6
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ export function write_tsconfig(config, cwd = process.cwd()) {
5353
include.push(config_relative(`${relative}/**/*.ts`));
5454
include.push(config_relative(`${relative}/**/*.svelte`));
5555
}
56+
// Test folder is a special case - we advocate putting tests in a top-level test folder
57+
// and it's not configurable (should we make it?)
58+
const test_folder = project_relative('tests');
59+
include.push(config_relative(`${test_folder}/**/*.js`));
60+
include.push(config_relative(`${test_folder}/**/*.ts`));
61+
include.push(config_relative(`${test_folder}/**/*.svelte`));
5662

5763
write_if_changed(
5864
out,

0 commit comments

Comments
 (0)