Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/adapter-auto/test/adapters.spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assert, test } from 'vitest';
import { adapters } from 'adapters.js';
import { adapters } from '../adapters.js';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vitest seems to be strict about explicitly specifying relative paths vs package names

import { existsSync, readFileSync } from 'node:fs';

test('adapter versions are up to date', () => {
Expand Down
4 changes: 3 additions & 1 deletion packages/adapter-vercel/test/utils.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import { assert, test, describe } from 'vitest';
import { get_pathname, parse_isr_expiration, pattern_to_src, resolve_runtime } from '../utils.js';

// workaround so that TypeScript doesn't follow that import which makes it pick up that file and then error on missing import aliases
const { parse_route_id } = await import('../../kit/src/' + 'utils/routing.js');
const { parse_route_id } = await import(
new URL('../../kit/src/' + 'utils/routing.js', import.meta.url).href
Copy link
Member

@teemingc teemingc Jan 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using the module location as a base helps resolve the correct path. Otherwise, it errors with Vitest 4. This wouldn't happen if we weren't concatenating the path string. But we need to do that to prevent TypeScript from type checking the imported file which contains references to kit types that are not aliased in this package

);

/**
* @param {import('@sveltejs/kit').RouteDefinition<any>['segments']} segments
Expand Down
7 changes: 2 additions & 5 deletions packages/kit/kit.vitest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,8 @@ export default defineConfig({
alias: {
'__sveltekit/paths': fileURLToPath(new URL('./test/mocks/path.js', import.meta.url))
},
poolOptions: {
threads: {
singleThread: true
}
},
pool: 'threads',
maxWorkers: 1,
include: ['src/**/*.spec.js'],
exclude: [
'**/node_modules/**',
Expand Down
2 changes: 1 addition & 1 deletion packages/kit/test/apps/basics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"@opentelemetry/sdk-trace-node": "catalog:",
"@sveltejs/kit": "workspace:^",
"@sveltejs/vite-plugin-svelte": "catalog:",
"@vitest/browser": "catalog:",
"@vitest/browser-playwright": "catalog:",
"svelte": "catalog:",
"svelte-check": "catalog:",
"test-redirect-importer": "workspace:*",
Expand Down
7 changes: 3 additions & 4 deletions packages/kit/test/apps/basics/vite.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as path from 'node:path';
import { sveltekit } from '@sveltejs/kit/vite';
import { playwright } from '@vitest/browser-playwright';
import { defineConfig } from 'vitest/config';

export default defineConfig({
Expand All @@ -25,15 +26,13 @@ export default defineConfig({
extends: './vite.config.js',
test: {
name: 'client',
environment: 'browser',
browser: {
enabled: true,
provider: 'playwright',
provider: playwright(),
instances: [{ browser: 'chromium' }],
headless: true
},
include: ['unit-test/**/*.spec.js'],
setupFiles: ['./vitest-setup-client.ts']
include: ['unit-test/**/*.spec.js']
}
}
]
Expand Down
2 changes: 0 additions & 2 deletions packages/kit/test/apps/basics/vitest-setup-client.ts

This file was deleted.

2 changes: 1 addition & 1 deletion packages/kit/test/prerendering/basics/vite.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as path from 'node:path';
import { sveltekit } from '@sveltejs/kit/vite';

/** @type {import('vitest/config').UserConfig} */
/** @type {import('vitest/config').ViteUserConfig} */
const config = {
build: {
minify: false
Expand Down
Loading
Loading