Skip to content

Commit 62efded

Browse files
committed
need to look at tests again in demo
1 parent 7cf5b27 commit 62efded

File tree

5 files changed

+14
-29
lines changed

5 files changed

+14
-29
lines changed

packages/sv/lib/cli/tests/cli.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,15 @@ describe('cli', () => {
4141
{
4242
projectName: 'create-addon',
4343
template: 'addon',
44-
types: 'jsdoc',
4544
args: ['--no-add-ons']
4645
}
4746
];
4847

4948
it.for(testCases)(
5049
'should create a new project with name $projectName',
51-
{ timeout: 10_000 },
50+
{ timeout: 20_000 },
5251
async (testCase) => {
53-
const { projectName, args, template = 'minimal', types = 'ts' } = testCase;
52+
const { projectName, args, template = 'minimal' } = testCase;
5453
const testOutputPath = path.resolve(monoRepoPath, '.test-output', 'cli', projectName);
5554

5655
const result = await exec(
@@ -61,16 +60,15 @@ describe('cli', () => {
6160
testOutputPath,
6261
'--template',
6362
template,
64-
'--types',
65-
types,
63+
...(template === 'addon' ? ['--no-types'] : ['--types', 'ts']),
6664
'--no-install',
6765
...args
6866
],
6967
{ nodeOptions: { stdio: 'pipe' } }
7068
);
7169

7270
// cli finished well
73-
expect(result.exitCode).toBe(0);
71+
expect(result.exitCode, `Error with cli: '${result.stderr}'`).toBe(0);
7472

7573
// test output path exists
7674
expect(fs.existsSync(testOutputPath)).toBe(true);
@@ -114,11 +112,11 @@ describe('cli', () => {
114112

115113
if (template === 'addon') {
116114
const cmds = [
115+
// list of cmds to test
117116
['i'],
118117
['run', 'demo-create'],
119118
['run', 'demo-add'],
120-
// TODO JYC: check is failing because it's requesting kit! :o
121-
['run', 'check']
119+
['run', 'test']
122120
];
123121
for (const cmd of cmds) {
124122
const res = await exec('npm', cmd, {
Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,10 @@
11
{
2-
"extends": "./.svelte-kit/tsconfig.json",
2+
"exclude": ["**/temp/**"],
33
"compilerOptions": {
4-
"allowJs": true,
5-
"checkJs": true,
6-
"esModuleInterop": true,
7-
"forceConsistentCasingInFileNames": true,
8-
"resolveJsonModule": true,
9-
"skipLibCheck": true,
10-
"sourceMap": true,
114
"strict": true,
12-
"moduleResolution": "bundler"
5+
"skipLibCheck": true,
6+
"checkJs": true,
7+
"module": "Node16",
8+
"moduleResolution": "Node16"
139
}
14-
// Path aliases are handled by https://svelte.dev/docs/kit/configuration#alias
15-
// except $lib which is handled by https://svelte.dev/docs/kit/configuration#files
16-
//
17-
// If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes
18-
// from the referenced tsconfig.json - TypeScript does not merge them in
1910
}

packages/sv/lib/cli/tests/snapshots/create-addon/package.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
"scripts": {
77
"demo-create": "sv create demo --types ts --template minimal --no-add-ons --no-install",
88
"demo-add": "sv add -C demo --community file:../ --no-git-check --no-install",
9-
"test": "vitest run",
10-
"check": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json",
11-
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json --watch"
9+
"test": "vitest run"
1210
},
1311
"files": [
1412
"src",
@@ -20,8 +18,6 @@
2018
},
2119
"devDependencies": {
2220
"@playwright/test": "^1.56.1",
23-
"svelte-check": "^4.3.4",
24-
"typescript": "^5.9.3",
2521
"vitest": "4.0.7"
2622
},
2723
"keywords": [

packages/sv/lib/cli/tests/snapshots/create-addon/vitest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default defineConfig({
88
exclude: ['tests/setup/*'],
99
testTimeout: ONE_MINUTE * 3,
1010
hookTimeout: ONE_MINUTE * 3,
11-
globalSetup: ['tests/setup/global.ts'],
11+
globalSetup: ['tests/setup/global.js'],
1212
expect: {
1313
requireAssertions: true
1414
}

packages/sv/lib/create/templates/addon/vitest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default defineConfig({
88
exclude: ['tests/setup/*'],
99
testTimeout: ONE_MINUTE * 3,
1010
hookTimeout: ONE_MINUTE * 3,
11-
globalSetup: ['tests/setup/global.ts'],
11+
globalSetup: ['tests/setup/global.js'],
1212
expect: {
1313
requireAssertions: true
1414
}

0 commit comments

Comments
 (0)