Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix] add test folder to includes #6085

Merged
merged 3 commits into from Aug 20, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/hot-lions-cough.md
@@ -0,0 +1,5 @@
---
'create-svelte': patch
---

Add notes about includes/excludes and path aliases
benmccann marked this conversation as resolved.
Show resolved Hide resolved
5 changes: 5 additions & 0 deletions .changeset/warm-pots-melt.md
@@ -0,0 +1,5 @@
---
'@sveltejs/kit': patch
---

Add test folder to generated tsconfig
4 changes: 4 additions & 0 deletions packages/create-svelte/shared/+checkjs/jsconfig.json
Expand Up @@ -10,4 +10,8 @@
"sourceMap": true,
"strict": true
}
// Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias and https://kit.svelte.dev/docs/configuration#files
//
// If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes
// from the referenced tsconfig.json - TypeScript does not merge them in
}
4 changes: 4 additions & 0 deletions packages/create-svelte/shared/+typescript/tsconfig.json
Expand Up @@ -10,4 +10,8 @@
"sourceMap": true,
"strict": true
}
// Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias and https://kit.svelte.dev/docs/configuration#files
dummdidumm marked this conversation as resolved.
Show resolved Hide resolved
//
// If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes
// from the referenced tsconfig.json - TypeScript does not merge them in
}
6 changes: 6 additions & 0 deletions packages/kit/src/core/sync/write_tsconfig.js
Expand Up @@ -53,6 +53,12 @@ export function write_tsconfig(config, cwd = process.cwd()) {
include.push(config_relative(`${relative}/**/*.ts`));
include.push(config_relative(`${relative}/**/*.svelte`));
}
// Test folder is a special case - we advocate putting tests in a top-level test folder
// and it's not configurable (should we make it?)
const test_folder = project_relative('test');
Rich-Harris marked this conversation as resolved.
Show resolved Hide resolved
include.push(config_relative(`${test_folder}/**/*.js`));
include.push(config_relative(`${test_folder}/**/*.ts`));
include.push(config_relative(`${test_folder}/**/*.svelte`));

write_if_changed(
out,
Expand Down