From 9f5642d156a797160abac58a29beca417bf53df8 Mon Sep 17 00:00:00 2001
From: Ben McCann <322311+benmccann@users.noreply.github.com>
Date: Sat, 13 May 2023 13:54:43 -0700
Subject: [PATCH] chore: switch from uvu to vitest (#9899)
---
packages/adapter-netlify/package.json | 4 +-
packages/adapter-netlify/src/headers.spec.js | 11 +-
packages/adapter-node/package.json | 4 +-
.../tests/{smoke.js => smoke.spec.js} | 3 +-
packages/adapter-vercel/package.json | 4 +-
packages/adapter-vercel/test/utils.spec.js | 5 +-
packages/kit/kit.vitest.config.js | 18 +
packages/kit/package.json | 6 +-
packages/kit/src/core/adapt/builder.spec.js | 17 +-
packages/kit/src/core/config/index.spec.js | 20 +-
packages/kit/src/core/postbuild/crawl.spec.js | 7 +-
.../kit/src/core/postbuild/entities.spec.js | 15 +-
packages/kit/src/core/postbuild/queue.spec.js | 19 +-
.../sync/create_manifest_data/index.spec.js | 101 ++---
.../kit/src/core/sync/write_tsconfig.spec.js | 11 +-
.../src/core/sync/write_types/index.spec.js | 23 +-
.../kit/src/exports/hooks/sequence.spec.js | 7 +-
.../exports/vite/graph_analysis/index.spec.js | 5 +-
.../exports/vite/graph_analysis/utils.spec.js | 3 +-
packages/kit/src/exports/vite/utils.spec.js | 7 +-
.../kit/src/runtime/server/cookie.spec.js | 22 +-
.../src/runtime/server/page/crypto.spec.js | 5 +-
.../kit/src/runtime/server/page/csp.spec.js | 7 +-
.../src/runtime/server/page/load_data.spec.js | 19 +-
.../server/page/serialize_data.spec.js | 5 +-
packages/kit/src/utils/escape.spec.js | 5 +-
packages/kit/src/utils/exports.spec.js | 5 +-
packages/kit/src/utils/filesystem.spec.js | 33 +-
packages/kit/src/utils/http.spec.js | 5 +-
packages/kit/src/utils/routing.spec.js | 16 +-
packages/kit/src/utils/streaming.spec.js | 7 +-
packages/kit/src/utils/unit_test.js | 11 -
packages/kit/src/utils/url.spec.js | 7 +-
packages/kit/test/build-errors/env.spec.js | 5 +-
packages/kit/test/build-errors/package.json | 6 +-
.../kit/test/build-errors/prerender.spec.js | 13 +-
.../kit/test/build-errors/server-only.spec.js | 13 +-
.../{syntax-error.js => syntax-error.spec.js} | 7 +-
.../kit/test/prerendering/basics/package.json | 6 +-
.../basics/test/{test.js => tests.spec.js} | 54 +--
.../test/prerendering/options/package.json | 6 +-
.../options/test/{test.js => tests.spec.js} | 18 +-
.../test/prerendering/paths-base/package.json | 6 +-
.../test/{test.js => tests.spec.js} | 5 +-
.../migrations/package/migrate_config.spec.js | 5 +-
.../migrations/package/migrate_pkg.spec.js | 9 +-
.../routes/migrate_page_js/index.spec.js | 5 +-
.../routes/migrate_page_server/index.spec.js | 5 +-
.../routes/migrate_scripts/index.spec.js | 5 +-
.../routes/migrate_server/index.spec.js | 5 +-
packages/migrate/package.json | 5 +-
pnpm-lock.yaml | 423 ++++++++++++++++--
sites/kit.svelte.dev/package.json | 6 +-
.../src/lib/docs/server/index.spec.js | 5 +-
54 files changed, 639 insertions(+), 410 deletions(-)
rename packages/adapter-node/tests/{smoke.js => smoke.spec.js} (96%)
create mode 100644 packages/kit/kit.vitest.config.js
delete mode 100644 packages/kit/src/utils/unit_test.js
rename packages/kit/test/build-errors/{syntax-error.js => syntax-error.spec.js} (81%)
rename packages/kit/test/prerendering/basics/test/{test.js => tests.spec.js} (81%)
rename packages/kit/test/prerendering/options/test/{test.js => tests.spec.js} (72%)
rename packages/kit/test/prerendering/paths-base/test/{test.js => tests.spec.js} (91%)
diff --git a/packages/adapter-netlify/package.json b/packages/adapter-netlify/package.json
index 3da0e38302e9..f082012cd2fc 100644
--- a/packages/adapter-netlify/package.json
+++ b/packages/adapter-netlify/package.json
@@ -26,7 +26,7 @@
"scripts": {
"dev": "rimraf files && rollup -cw",
"build": "rimraf files && rollup -c && cp src/edge.js files/edge.js",
- "test": "uvu src \"(spec\\.js|test[\\\\/]index\\.js)\"",
+ "test": "vitest run",
"check": "tsc",
"lint": "prettier --check . --config ../../.prettierrc --ignore-path .gitignore",
"format": "pnpm lint --write",
@@ -48,7 +48,7 @@
"rimraf": "^5.0.0",
"rollup": "^3.7.0",
"typescript": "^4.9.4",
- "uvu": "^0.5.6"
+ "vitest": "^0.31.0"
},
"peerDependencies": {
"@sveltejs/kit": "^1.5.0"
diff --git a/packages/adapter-netlify/src/headers.spec.js b/packages/adapter-netlify/src/headers.spec.js
index 8a254ae36447..352987f3bdc5 100644
--- a/packages/adapter-netlify/src/headers.spec.js
+++ b/packages/adapter-netlify/src/headers.spec.js
@@ -1,6 +1,5 @@
+import { expect, test } from 'vitest';
import './shims.js';
-import { test } from 'uvu';
-import * as assert from 'uvu/assert';
import { split_headers } from './headers.js';
test('empty headers', () => {
@@ -8,7 +7,7 @@ test('empty headers', () => {
const result = split_headers(headers);
- assert.equal(result, {
+ expect(result).toEqual({
headers: {},
multiValueHeaders: {}
});
@@ -21,7 +20,7 @@ test('single-value headers', () => {
const result = split_headers(headers);
- assert.equal(result, {
+ expect(result).toEqual({
headers: {
// Note: becomes lowercase even if specified as uppercase
location: '/apple',
@@ -43,12 +42,10 @@ test('multi-value headers', () => {
const result = split_headers(headers);
// it splits at actual cookie boundaries, not the commas in the dates
- assert.equal(result, {
+ expect(result).toEqual({
headers: {},
multiValueHeaders: {
'set-cookie': [`flavor=sugar; Expires=${wednesday}`, `diameter=6cm; Expires=${thursday}`]
}
});
});
-
-test.run();
diff --git a/packages/adapter-node/package.json b/packages/adapter-node/package.json
index bcad3220a270..65e0bfb1dd88 100644
--- a/packages/adapter-node/package.json
+++ b/packages/adapter-node/package.json
@@ -26,7 +26,7 @@
"scripts": {
"dev": "rimraf files && rollup -cw",
"build": "rimraf files && rollup -c",
- "test": "echo \"tests temporarily disabled\" # c8 uvu tests",
+ "test": "echo \"tests temporarily disabled\" # c8 vitest run",
"check": "tsc",
"lint": "prettier --check . --config ../../.prettierrc --ignore-path .gitignore",
"format": "pnpm lint --write",
@@ -41,7 +41,7 @@
"rimraf": "^5.0.0",
"sirv": "^2.0.3",
"typescript": "^4.9.4",
- "uvu": "^0.5.6"
+ "vitest": "^0.31.0"
},
"dependencies": {
"@rollup/plugin-commonjs": "^25.0.0",
diff --git a/packages/adapter-node/tests/smoke.js b/packages/adapter-node/tests/smoke.spec.js
similarity index 96%
rename from packages/adapter-node/tests/smoke.js
rename to packages/adapter-node/tests/smoke.spec.js
index 55a80de34081..ea7f27658cf6 100644
--- a/packages/adapter-node/tests/smoke.js
+++ b/packages/adapter-node/tests/smoke.spec.js
@@ -1,6 +1,5 @@
-import { test } from 'uvu';
+import { assert, test } from 'vitest';
import { create_kit_middleware } from '../src/handler.js';
-import * as assert from 'uvu/assert';
import fetch from 'node-fetch';
import polka from 'polka';
diff --git a/packages/adapter-vercel/package.json b/packages/adapter-vercel/package.json
index 4bffbe113a04..b57df0ae2372 100644
--- a/packages/adapter-vercel/package.json
+++ b/packages/adapter-vercel/package.json
@@ -28,7 +28,7 @@
"lint": "prettier --check . --config ../../.prettierrc --ignore-path .gitignore",
"format": "pnpm lint --write",
"check": "tsc",
- "test": "uvu test .spec.js"
+ "test": "vitest run"
},
"dependencies": {
"@vercel/nft": "^0.22.6",
@@ -38,7 +38,7 @@
"@sveltejs/kit": "workspace:^",
"@types/node": "^16.18.6",
"typescript": "^4.9.4",
- "uvu": "^0.5.6"
+ "vitest": "^0.31.0"
},
"peerDependencies": {
"@sveltejs/kit": "^1.5.0"
diff --git a/packages/adapter-vercel/test/utils.spec.js b/packages/adapter-vercel/test/utils.spec.js
index 980d2687d47b..077040135338 100644
--- a/packages/adapter-vercel/test/utils.spec.js
+++ b/packages/adapter-vercel/test/utils.spec.js
@@ -1,5 +1,4 @@
-import { test } from 'uvu';
-import * as assert from 'uvu/assert';
+import { assert, test } from 'vitest';
import { get_pathname } from '../utils.js';
/**
@@ -34,5 +33,3 @@ test('get_pathname for route with parameters within segment', () => {
'foo-$1/$2-buz'
);
});
-
-test.run();
diff --git a/packages/kit/kit.vitest.config.js b/packages/kit/kit.vitest.config.js
new file mode 100644
index 000000000000..189f9828fc39
--- /dev/null
+++ b/packages/kit/kit.vitest.config.js
@@ -0,0 +1,18 @@
+import { defineConfig } from 'vitest/config';
+
+// this file needs a custom name so that the numerous test subprojects don't all pick it up
+export default defineConfig({
+ test: {
+ // shave a couple seconds off the tests
+ isolate: false,
+ singleThread: true,
+ include: ['src/**/*.spec.js'],
+ exclude: [
+ '**/node_modules/**',
+ '**/.svelte-kit/**',
+ '**/.{idea,git,cache,output,temp}/**',
+ '**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build}.config.*'
+ ],
+ watchExclude: ['**/node_modules/**', '**/.svelte-kit/**']
+ }
+});
diff --git a/packages/kit/package.json b/packages/kit/package.json
index 523814b8a895..7e7260c5ad0d 100644
--- a/packages/kit/package.json
+++ b/packages/kit/package.json
@@ -38,8 +38,8 @@
"svelte": "^3.56.0",
"svelte-preprocess": "^5.0.3",
"typescript": "^4.9.4",
- "uvu": "^0.5.6",
- "vite": "^4.3.0"
+ "vite": "^4.3.0",
+ "vitest": "^0.31.0"
},
"peerDependencies": {
"svelte": "^3.54.0",
@@ -66,7 +66,7 @@
"test:integration": "pnpm -r --workspace-concurrency 1 --filter=\"./test/**\" test",
"test:cross-platform:dev": "pnpm -r --workspace-concurrency 1 --filter=\"./test/**\" test:cross-platform:dev",
"test:cross-platform:build": "pnpm test:unit && pnpm -r --workspace-concurrency 1 --filter=\"./test/**\" test:cross-platform:build",
- "test:unit": "uvu src \"(spec\\.js|test[\\\\/]index\\.js)\"",
+ "test:unit": "vitest --config kit.vitest.config.js run",
"postinstall": "node postinstall.js"
},
"exports": {
diff --git a/packages/kit/src/core/adapt/builder.spec.js b/packages/kit/src/core/adapt/builder.spec.js
index 7f449d48b5a8..16832bef7d41 100644
--- a/packages/kit/src/core/adapt/builder.spec.js
+++ b/packages/kit/src/core/adapt/builder.spec.js
@@ -1,8 +1,7 @@
import { rmSync } from 'node:fs';
import { join } from 'node:path';
import { fileURLToPath } from 'node:url';
-import { test } from 'uvu';
-import * as assert from 'uvu/assert';
+import { expect, test } from 'vitest';
import glob from 'tiny-glob/sync.js';
import { create_builder } from './builder.js';
import { posixify } from '../../utils/filesystem.js';
@@ -47,29 +46,23 @@ test('copy files', () => {
rmSync(dest, { recursive: true, force: true });
- assert.equal(
- builder.writeClient(dest),
+ expect(builder.writeClient(dest)).toEqual(
glob('**', { cwd: dest, dot: true, filesOnly: true }).map(posixify)
);
- assert.equal(
- glob('**', { cwd: `${outDir}/output/client`, dot: true }),
+ expect(glob('**', { cwd: `${outDir}/output/client`, dot: true })).toEqual(
glob('**', { cwd: dest, dot: true })
);
rmSync(dest, { recursive: true, force: true });
- assert.equal(
- builder.writeServer(dest),
+ expect(builder.writeServer(dest)).toEqual(
glob('**', { cwd: dest, dot: true, filesOnly: true }).map(posixify)
);
- assert.equal(
- glob('**', { cwd: `${outDir}/output/server`, dot: true }),
+ expect(glob('**', { cwd: `${outDir}/output/server`, dot: true })).toEqual(
glob('**', { cwd: dest, dot: true })
);
rmSync(dest, { force: true, recursive: true });
});
-
-test.run();
diff --git a/packages/kit/src/core/config/index.spec.js b/packages/kit/src/core/config/index.spec.js
index 56e42a55ab4b..6fc1066b1279 100644
--- a/packages/kit/src/core/config/index.spec.js
+++ b/packages/kit/src/core/config/index.spec.js
@@ -1,7 +1,6 @@
import { join } from 'node:path';
import { fileURLToPath } from 'node:url';
-import { test } from 'uvu';
-import * as assert from 'uvu/assert';
+import { assert, expect, test } from 'vitest';
import { validate_config, load_config } from './index.js';
const __filename = fileURLToPath(import.meta.url);
@@ -124,7 +123,7 @@ test('fills in defaults', () => {
const defaults = get_defaults();
defaults.kit.version.name = validated.kit.version.name;
- assert.equal(validated, defaults);
+ expect(validated).toEqual(defaults);
});
test('errors on invalid values', () => {
@@ -152,7 +151,7 @@ test('errors on invalid nested values', () => {
});
test('does not error on invalid top-level values', () => {
- assert.not.throws(() => {
+ assert.doesNotThrow(() => {
validate_config({
onwarn: () => {}
});
@@ -187,7 +186,7 @@ test('fills in partial blanks', () => {
config.kit.files.assets = 'public';
config.kit.version.name = '0';
- assert.equal(validated, config);
+ expect(validated).toEqual(config);
});
test('fails if kit.appDir is blank', () => {
@@ -300,14 +299,13 @@ test('fails if prerender.entries are invalid', () => {
*/
function validate_paths(name, input, output) {
test(name, () => {
- assert.equal(
+ expect(
validate_config({
kit: {
paths: input
}
- }).kit.paths,
- output
- );
+ }).kit.paths
+ ).toEqual(output);
});
}
@@ -357,7 +355,7 @@ test('load default config (esm)', async () => {
const defaults = get_defaults(cwd + '/');
defaults.kit.version.name = config.kit.version.name;
- assert.equal(config, defaults);
+ expect(config).toEqual(defaults);
});
test('errors on loading config with incorrect default export', async () => {
@@ -375,5 +373,3 @@ test('errors on loading config with incorrect default export', async () => {
'svelte.config.js must have a configuration object as its default export. See https://kit.svelte.dev/docs/configuration'
);
});
-
-test.run();
diff --git a/packages/kit/src/core/postbuild/crawl.spec.js b/packages/kit/src/core/postbuild/crawl.spec.js
index c62b15552ebd..46a5d4d950bd 100644
--- a/packages/kit/src/core/postbuild/crawl.spec.js
+++ b/packages/kit/src/core/postbuild/crawl.spec.js
@@ -1,7 +1,6 @@
import fs from 'node:fs';
import { fileURLToPath } from 'node:url';
-import { test } from 'uvu';
-import * as assert from 'uvu/assert';
+import { expect, test } from 'vitest';
import { crawl } from './crawl.js';
const fixtures = fileURLToPath(new URL('./fixtures', import.meta.url));
@@ -18,8 +17,6 @@ for (const fixture of fs.readdirSync(fixtures)) {
// uncomment to see how long it took
// console.error(fixture, Date.now() - start);
- assert.equal(output, expected);
+ expect(output).toEqual(expected);
});
}
-
-test.run();
diff --git a/packages/kit/src/core/postbuild/entities.spec.js b/packages/kit/src/core/postbuild/entities.spec.js
index 92b63827c640..d48f659539c4 100644
--- a/packages/kit/src/core/postbuild/entities.spec.js
+++ b/packages/kit/src/core/postbuild/entities.spec.js
@@ -1,5 +1,4 @@
-import { test } from 'uvu';
-import * as assert from 'uvu/assert';
+import { assert, test } from 'vitest';
import { decode } from './entities.js';
/*
@@ -37,24 +36,22 @@ const tests = [
for (const { input, output } of tests) {
test(input, () => {
- assert.is(decode(input), output);
+ assert.equal(decode(input), output);
});
}
test('should HTML decode partial legacy entity', () => {
- assert.is(decode('×bar'), '×bar');
+ assert.equal(decode('×bar'), '×bar');
});
test('should HTML decode legacy entities according to spec', () => {
- assert.is(decode('?&image_uri=1&ℑ=2&image=3'), '?&image_uri=1&ℑ=2&image=3');
+ assert.equal(decode('?&image_uri=1&ℑ=2&image=3'), '?&image_uri=1&ℑ=2&image=3');
});
test('should back out of legacy entities', () => {
- assert.is(decode('&a'), '&a');
+ assert.equal(decode('&a'), '&a');
});
test('should parse   followed by < (#852)', () => {
- assert.is(decode(' <'), '\u00a0<');
+ assert.equal(decode(' <'), '\u00a0<');
});
-
-test.run();
diff --git a/packages/kit/src/core/postbuild/queue.spec.js b/packages/kit/src/core/postbuild/queue.spec.js
index 3fdb65768889..deb13a7f7119 100644
--- a/packages/kit/src/core/postbuild/queue.spec.js
+++ b/packages/kit/src/core/postbuild/queue.spec.js
@@ -1,5 +1,4 @@
-import { test } from 'uvu';
-import * as assert from 'uvu/assert';
+import { assert, expect, test } from 'vitest';
import { queue } from './queue.js';
/** @param {number} ms */
@@ -53,26 +52,26 @@ test('starts tasks in sequence', async () => {
});
}
- assert.equal(started, [true, true, false, false]);
- assert.equal(finished, [false, false, false, false]);
+ expect(started).toEqual([true, true, false, false]);
+ expect(finished).toEqual([false, false, false, false]);
fulfils[0]();
await promises[0];
- assert.equal(started, [true, true, true, false]);
- assert.equal(finished, [true, false, false, false]);
+ expect(started).toEqual([true, true, true, false]);
+ expect(finished).toEqual([true, false, false, false]);
fulfils[1]();
await promises[1];
- assert.equal(started, [true, true, true, true]);
- assert.equal(finished, [true, true, false, false]);
+ expect(started).toEqual([true, true, true, true]);
+ expect(finished).toEqual([true, true, false, false]);
fulfils[2]();
fulfils[3]();
await q.done();
- assert.equal(finished, [true, true, true, true]);
+ expect(finished).toEqual([true, true, true, true]);
});
test('q.add fails if queue is already finished', async () => {
@@ -110,5 +109,3 @@ test('q.done() rejects if task rejects', async () => {
assert.equal(/** @type {Error} */ (e).message, 'nope');
}
});
-
-test.run();
diff --git a/packages/kit/src/core/sync/create_manifest_data/index.spec.js b/packages/kit/src/core/sync/create_manifest_data/index.spec.js
index c1aca3b967bf..cde94b1c1489 100644
--- a/packages/kit/src/core/sync/create_manifest_data/index.spec.js
+++ b/packages/kit/src/core/sync/create_manifest_data/index.spec.js
@@ -1,8 +1,7 @@
import fs from 'node:fs';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
-import { test } from 'uvu';
-import * as assert from 'uvu/assert';
+import { assert, expect, test } from 'vitest';
import create_manifest_data from './index.js';
import options from '../../config/options.js';
import { sort_routes } from './sort.js';
@@ -65,7 +64,7 @@ function simplify_route(route) {
test('creates routes', () => {
const { nodes, routes } = create('samples/basic');
- assert.equal(nodes.map(simplify_node), [
+ expect(nodes.map(simplify_node)).toEqual([
default_layout,
default_error,
{ component: 'samples/basic/+page.svelte' },
@@ -74,7 +73,7 @@ test('creates routes', () => {
{ component: 'samples/basic/blog/[slug]/+page.svelte' }
]);
- assert.equal(routes.map(simplify_route), [
+ expect(routes.map(simplify_route)).toEqual([
{
id: '/',
pattern: '/^/$/',
@@ -119,14 +118,14 @@ const test_symlinks = symlink_survived_git ? test : test.skip;
test_symlinks('creates symlinked routes', () => {
const { nodes, routes } = create('samples/symlinks/routes');
- assert.equal(nodes.map(simplify_node), [
+ expect(nodes.map(simplify_node)).toEqual([
default_layout,
default_error,
{ component: 'samples/symlinks/routes/foo/index.svelte' },
{ component: 'samples/symlinks/routes/index.svelte' }
]);
- assert.equal(routes, [
+ expect(routes).toEqual([
{
id: '/',
pattern: '/^/$/',
@@ -144,7 +143,7 @@ test_symlinks('creates symlinked routes', () => {
test('creates routes with layout', () => {
const { nodes, routes } = create('samples/basic-layout');
- assert.equal(nodes.map(simplify_node), [
+ expect(nodes.map(simplify_node)).toEqual([
{ component: 'samples/basic-layout/+layout.svelte' },
default_error,
{ component: 'samples/basic-layout/foo/+layout.svelte' },
@@ -152,7 +151,7 @@ test('creates routes with layout', () => {
{ component: 'samples/basic-layout/foo/+page.svelte' }
]);
- assert.equal(routes.map(simplify_route), [
+ expect(routes.map(simplify_route)).toEqual([
{
id: '/',
pattern: '/^/$/',
@@ -169,11 +168,11 @@ test('creates routes with layout', () => {
test('succeeds when routes does not exist', () => {
const { nodes, routes } = create('samples/basic/routes');
- assert.equal(nodes.map(simplify_node), [
+ expect(nodes.map(simplify_node)).toEqual([
{ component: 'layout.svelte' },
{ component: 'error.svelte' }
]);
- assert.equal(routes.map(simplify_route), [
+ expect(routes.map(simplify_route)).toEqual([
{
id: '/',
pattern: '/^$/'
@@ -188,7 +187,7 @@ test('encodes invalid characters', () => {
const hash = { component: 'samples/encoding/[x+23]/+page.svelte' };
const question_mark = { component: 'samples/encoding/[x+3f]/+page.svelte' };
- assert.equal(nodes.map(simplify_node), [
+ expect(nodes.map(simplify_node)).toEqual([
default_layout,
default_error,
quote,
@@ -196,8 +195,7 @@ test('encodes invalid characters', () => {
question_mark
]);
- assert.equal(
- routes.map((p) => p.pattern.toString()),
+ expect(routes.map((p) => p.pattern.toString())).toEqual(
[/^\/$/, /^\/%3[Ff]\/?$/, /^\/%23\/?$/, /^\/"\/?$/].map((pattern) => pattern.toString())
);
});
@@ -240,13 +238,13 @@ test('sorts routes correctly', () => {
(route) => route.id
);
- assert.equal(actual, expected);
+ expect(actual).toEqual(expected);
});
test('sorts routes with rest correctly', () => {
const { nodes, routes } = create('samples/rest');
- assert.equal(nodes.map(simplify_node), [
+ expect(nodes.map(simplify_node)).toEqual([
default_layout,
default_error,
{
@@ -259,7 +257,7 @@ test('sorts routes with rest correctly', () => {
}
]);
- assert.equal(routes.map(simplify_route), [
+ expect(routes.map(simplify_route)).toEqual([
{
id: '/',
pattern: '/^/$/'
@@ -288,7 +286,7 @@ test('sorts routes with rest correctly', () => {
test('allows rest parameters inside segments', () => {
const { nodes, routes } = create('samples/rest-prefix-suffix');
- assert.equal(nodes.map(simplify_node), [
+ expect(nodes.map(simplify_node)).toEqual([
default_layout,
default_error,
{
@@ -296,7 +294,7 @@ test('allows rest parameters inside segments', () => {
}
]);
- assert.equal(routes.map(simplify_route), [
+ expect(routes.map(simplify_route)).toEqual([
{
id: '/',
pattern: '/^/$/'
@@ -319,29 +317,28 @@ test('allows rest parameters inside segments', () => {
test('optional parameters', () => {
const { nodes, routes } = create('samples/optional');
- assert.equal(
+ expect(
nodes
.map(simplify_node)
// for some reason linux and windows have a different order, which is why
// we need sort the nodes using a sort function (doesn't work either without),
// resulting in the following expected node order
- .sort((a, b) => a.component?.localeCompare(b.component ?? '') ?? 1),
- [
- default_error,
- default_layout,
- {
- component: 'samples/optional/[[optional]]/+page.svelte'
- },
- {
- component: 'samples/optional/nested/[[optional]]/sub/+page.svelte'
- },
- {
- component: 'samples/optional/prefix[[suffix]]/+page.svelte'
- }
- ]
- );
+ .sort((a, b) => a.component?.localeCompare(b.component ?? '') ?? 1)
+ ).toEqual([
+ default_error,
+ default_layout,
+ {
+ component: 'samples/optional/[[optional]]/+page.svelte'
+ },
+ {
+ component: 'samples/optional/nested/[[optional]]/sub/+page.svelte'
+ },
+ {
+ component: 'samples/optional/prefix[[suffix]]/+page.svelte'
+ }
+ ]);
- assert.equal(routes.map(simplify_route), [
+ expect(routes.map(simplify_route)).toEqual([
{
id: '/',
pattern: '/^/$/'
@@ -388,13 +385,13 @@ test('optional parameters', () => {
test('nested optionals', () => {
const { nodes, routes } = create('samples/nested-optionals');
- assert.equal(nodes.map(simplify_node), [
+ expect(nodes.map(simplify_node)).toEqual([
default_layout,
default_error,
{ component: 'samples/nested-optionals/[[a]]/[[b]]/+page.svelte' }
]);
- assert.equal(routes.map(simplify_route), [
+ expect(routes.map(simplify_route)).toEqual([
{
id: '/',
pattern: '/^/$/'
@@ -418,7 +415,7 @@ test('nested optionals', () => {
test('ignores files and directories with leading underscores', () => {
const { routes } = create('samples/hidden-underscore');
- assert.equal(routes.map((r) => r.endpoint?.file).filter(Boolean), [
+ expect(routes.map((r) => r.endpoint?.file).filter(Boolean)).toEqual([
'samples/hidden-underscore/e/f/g/h/+server.js'
]);
});
@@ -426,7 +423,7 @@ test('ignores files and directories with leading underscores', () => {
test('ignores files and directories with leading dots except .well-known', () => {
const { routes } = create('samples/hidden-dot');
- assert.equal(routes.map((r) => r.endpoint?.file).filter(Boolean), [
+ expect(routes.map((r) => r.endpoint?.file).filter(Boolean)).toEqual([
'samples/hidden-dot/.well-known/dnt-policy.txt/+server.js'
]);
});
@@ -434,7 +431,7 @@ test('ignores files and directories with leading dots except .well-known', () =>
test('allows multiple slugs', () => {
const { routes } = create('samples/multiple-slugs');
- assert.equal(routes.filter((route) => route.endpoint).map(simplify_route), [
+ expect(routes.filter((route) => route.endpoint).map(simplify_route)).toEqual([
{
id: '/[file].[ext]',
pattern: '/^/([^/]+?).([^/]+?)/?$/',
@@ -454,7 +451,7 @@ test('fails if dynamic params are not separated', () => {
test('ignores things that look like lockfiles', () => {
const { routes } = create('samples/lockfiles');
- assert.equal(routes.map(simplify_route), [
+ expect(routes.map(simplify_route)).toEqual([
{
id: '/',
pattern: '/^/$/'
@@ -474,7 +471,7 @@ test('works with custom extensions', () => {
extensions: ['.jazz', '.beebop', '.funk', '.svelte']
});
- assert.equal(nodes.map(simplify_node), [
+ expect(nodes.map(simplify_node)).toEqual([
default_layout,
default_error,
{ component: 'samples/custom-extension/+page.funk' },
@@ -483,7 +480,7 @@ test('works with custom extensions', () => {
{ component: 'samples/custom-extension/blog/[slug]/+page.beebop' }
]);
- assert.equal(routes.map(simplify_route), [
+ expect(routes.map(simplify_route)).toEqual([
{
id: '/',
pattern: '/^/$/',
@@ -524,7 +521,7 @@ test('works with custom extensions', () => {
test('lists static assets', () => {
const { assets } = create('samples/basic');
- assert.equal(assets, [
+ expect(assets).toEqual([
{
file: 'bar/baz.txt',
size: 14,
@@ -541,7 +538,7 @@ test('lists static assets', () => {
test('includes nested error components', () => {
const { nodes, routes } = create('samples/nested-errors');
- assert.equal(nodes.map(simplify_node), [
+ expect(nodes.map(simplify_node)).toEqual([
default_layout,
default_error,
{ component: 'samples/nested-errors/foo/+layout.svelte' },
@@ -551,7 +548,7 @@ test('includes nested error components', () => {
{ component: 'samples/nested-errors/foo/bar/baz/+page.svelte' }
]);
- assert.equal(routes.map(simplify_route), [
+ expect(routes.map(simplify_route)).toEqual([
{
id: '/',
pattern: '/^/$/'
@@ -575,7 +572,7 @@ test('includes nested error components', () => {
test('creates routes with named layouts', () => {
const { nodes, routes } = create('samples/named-layouts');
- assert.equal(nodes.map(simplify_node), [
+ expect(nodes.map(simplify_node)).toEqual([
// layouts
{ component: 'samples/named-layouts/+layout.svelte' }, // 0
default_error, // 1
@@ -604,7 +601,7 @@ test('creates routes with named layouts', () => {
{ component: 'samples/named-layouts/b/d/d1/+page.svelte' } // 15
]);
- assert.equal(routes.filter((route) => route.page).map(simplify_route), [
+ expect(routes.filter((route) => route.page).map(simplify_route)).toEqual([
{
id: '/a/a1',
pattern: '/^/a/a1/?$/',
@@ -651,7 +648,7 @@ test('creates routes with named layouts', () => {
test('handles pages without .svelte file', () => {
const { nodes, routes } = create('samples/page-without-svelte-file');
- assert.equal(nodes.map(simplify_node), [
+ expect(nodes.map(simplify_node)).toEqual([
default_layout,
default_error,
{ component: 'samples/page-without-svelte-file/error/+error.svelte' },
@@ -663,7 +660,7 @@ test('handles pages without .svelte file', () => {
{ server: 'samples/page-without-svelte-file/layout/redirect/+page.server.js' }
]);
- assert.equal(routes.map(simplify_route), [
+ expect(routes.map(simplify_route)).toEqual([
{
id: '/',
pattern: '/^/$/',
@@ -712,7 +709,7 @@ test('errors on invalid named layout reference', () => {
test('creates param matchers', () => {
const { matchers } = create('samples/basic'); // directory doesn't matter for the test
- assert.equal(matchers, {
+ expect(matchers).toEqual({
foo: path.join('params', 'foo.js'),
bar: path.join('params', 'bar.js')
});
@@ -781,5 +778,3 @@ test('errors with both ts and js handlers for the same route', () => {
/^Multiple endpoint files found in samples\/conflicting-ts-js-handlers-server\/ : \+server\.js and \+server\.ts/
);
});
-
-test.run();
diff --git a/packages/kit/src/core/sync/write_tsconfig.spec.js b/packages/kit/src/core/sync/write_tsconfig.spec.js
index 95444bcb405b..3921ecd51703 100644
--- a/packages/kit/src/core/sync/write_tsconfig.spec.js
+++ b/packages/kit/src/core/sync/write_tsconfig.spec.js
@@ -1,5 +1,4 @@
-import { test } from 'uvu';
-import * as assert from 'uvu/assert';
+import { assert, expect, test } from 'vitest';
import { validate_config } from '../config/index.js';
import { get_tsconfig } from './write_tsconfig.js';
@@ -19,7 +18,7 @@ test('Creates tsconfig path aliases from kit.alias', () => {
// $lib isn't part of the outcome because there's a "path exists"
// check in the implementation
- assert.equal(compilerOptions.paths, {
+ expect(compilerOptions.paths).toEqual({
simpleKey: ['../simple/value'],
'simpleKey/*': ['../simple/value/*'],
key: ['../value'],
@@ -44,7 +43,7 @@ test('Creates tsconfig path aliases from kit.alias with existing baseUrl', () =>
// $lib isn't part of the outcome because there's a "path exists"
// check in the implementation
- assert.equal(compilerOptions.paths, {
+ expect(compilerOptions.paths).toEqual({
simpleKey: ['simple/value'],
'simpleKey/*': ['simple/value/*'],
key: ['value'],
@@ -97,7 +96,7 @@ test('Creates tsconfig include from kit.files', () => {
const { include } = get_tsconfig(kit, false);
- assert.equal(include, [
+ expect(include).toEqual([
'ambient.d.ts',
'./types/**/$types.d.ts',
'../vite.config.ts',
@@ -112,5 +111,3 @@ test('Creates tsconfig include from kit.files', () => {
'../tests/**/*.svelte'
]);
});
-
-test.run();
diff --git a/packages/kit/src/core/sync/write_types/index.spec.js b/packages/kit/src/core/sync/write_types/index.spec.js
index 1971a959f6c7..fd6ef80db994 100644
--- a/packages/kit/src/core/sync/write_types/index.spec.js
+++ b/packages/kit/src/core/sync/write_types/index.spec.js
@@ -1,8 +1,7 @@
import { execSync } from 'node:child_process';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
-import { test } from 'uvu';
-import * as assert from 'uvu/assert';
+import { assert, expect, test } from 'vitest';
import { rimraf } from '../../../utils/filesystem.js';
import options from '../../config/options.js';
import create_manifest_data from '../create_manifest_data/index.js';
@@ -60,7 +59,7 @@ test('Rewrites types for a TypeScript module', () => {
const rewritten = tweak_types(source, false);
- assert.equal(rewritten?.exports, ['load']);
+ expect(rewritten?.exports).toEqual(['load']);
assert.equal(
rewritten?.code,
`// @ts-nocheck
@@ -85,7 +84,7 @@ test('Rewrites types for a TypeScript module without param', () => {
const rewritten = tweak_types(source, false);
- assert.equal(rewritten?.exports, ['load']);
+ expect(rewritten?.exports).toEqual(['load']);
assert.equal(
rewritten?.code,
`// @ts-nocheck
@@ -111,7 +110,7 @@ test('Rewrites types for a TypeScript module without param and jsdoc without typ
const rewritten = tweak_types(source, false);
- assert.equal(rewritten?.exports, ['load']);
+ expect(rewritten?.exports).toEqual(['load']);
assert.equal(
rewritten?.code,
`// @ts-nocheck
@@ -138,7 +137,7 @@ test('Rewrites types for a JavaScript module with `function`', () => {
const rewritten = tweak_types(source, false);
- assert.equal(rewritten?.exports, ['load']);
+ expect(rewritten?.exports).toEqual(['load']);
assert.equal(
rewritten?.code,
`// @ts-nocheck
@@ -165,7 +164,7 @@ test('Rewrites types for a JavaScript module with `const`', () => {
const rewritten = tweak_types(source, false);
- assert.equal(rewritten?.exports, ['load']);
+ expect(rewritten?.exports).toEqual(['load']);
assert.equal(
rewritten?.code,
`// @ts-nocheck
@@ -192,7 +191,7 @@ test('Appends @ts-nocheck after @ts-check', () => {
const rewritten = tweak_types(source, false);
- assert.equal(rewritten?.exports, ['load']);
+ expect(rewritten?.exports).toEqual(['load']);
assert.equal(
rewritten?.code,
`// @ts-check
@@ -221,7 +220,7 @@ test('Rewrites action types for a JavaScript module', () => {
const rewritten = tweak_types(source, true);
- assert.equal(rewritten?.exports, ['actions']);
+ expect(rewritten?.exports).toEqual(['actions']);
assert.equal(
rewritten?.code,
`// @ts-nocheck
@@ -250,7 +249,7 @@ test('Rewrites action types for a TypeScript module', () => {
const rewritten = tweak_types(source, true);
- assert.equal(rewritten?.exports, ['actions']);
+ expect(rewritten?.exports).toEqual(['actions']);
assert.equal(
rewritten?.code,
`// @ts-nocheck
@@ -283,9 +282,7 @@ test('Leaves satisfies operator untouched', () => {
const rewritten = tweak_types(source, true);
- assert.equal(rewritten?.exports, ['load', 'actions']);
+ expect(rewritten?.exports).toEqual(['load', 'actions']);
assert.equal(rewritten?.modified, false);
assert.equal(rewritten?.code, source);
});
-
-test.run();
diff --git a/packages/kit/src/exports/hooks/sequence.spec.js b/packages/kit/src/exports/hooks/sequence.spec.js
index 453688d56542..da5e4e8d1b2f 100644
--- a/packages/kit/src/exports/hooks/sequence.spec.js
+++ b/packages/kit/src/exports/hooks/sequence.spec.js
@@ -1,5 +1,4 @@
-import { test } from 'uvu';
-import * as assert from 'uvu/assert';
+import { assert, expect, test } from 'vitest';
import { sequence } from './sequence.js';
import { installPolyfills } from '../node/polyfills.js';
@@ -34,7 +33,7 @@ test('applies handlers in sequence', async () => {
const response = new Response();
assert.equal(await handler({ event, resolve: () => response }), response);
- assert.equal(order, ['1a', '2a', '3a', '3b', '2b', '1b']);
+ expect(order).toEqual(['1a', '2a', '3a', '3b', '2b', '1b']);
});
test('uses transformPageChunk option passed to non-terminal handle function', async () => {
@@ -168,5 +167,3 @@ test('uses first defined filterSerializedResponseHeaders option', async () => {
assert.equal(await response.text(), 'truefalse');
});
-
-test.run();
diff --git a/packages/kit/src/exports/vite/graph_analysis/index.spec.js b/packages/kit/src/exports/vite/graph_analysis/index.spec.js
index 2a3ee77382a5..0df0c26465bc 100644
--- a/packages/kit/src/exports/vite/graph_analysis/index.spec.js
+++ b/packages/kit/src/exports/vite/graph_analysis/index.spec.js
@@ -1,5 +1,4 @@
-import { test } from 'uvu';
-import * as assert from 'uvu/assert';
+import { assert, test } from 'vitest';
import { module_guard } from './index.js';
/**
@@ -159,5 +158,3 @@ test('ignores .server.js files outside the project root', () => {
'/illegal.server.js': {}
});
});
-
-test.run();
diff --git a/packages/kit/src/exports/vite/graph_analysis/utils.spec.js b/packages/kit/src/exports/vite/graph_analysis/utils.spec.js
index 8b1feb7882a4..f4b609c03ab7 100644
--- a/packages/kit/src/exports/vite/graph_analysis/utils.spec.js
+++ b/packages/kit/src/exports/vite/graph_analysis/utils.spec.js
@@ -1,5 +1,4 @@
-import { describe } from '../../../utils/unit_test.js';
-import * as assert from 'uvu/assert';
+import { assert, describe } from 'vitest';
import { remove_query_from_id } from './utils.js';
describe('remove_query_string_from_path', (test) => {
diff --git a/packages/kit/src/exports/vite/utils.spec.js b/packages/kit/src/exports/vite/utils.spec.js
index 62484d207e57..45569b13f5c7 100644
--- a/packages/kit/src/exports/vite/utils.spec.js
+++ b/packages/kit/src/exports/vite/utils.spec.js
@@ -1,6 +1,5 @@
import path from 'node:path';
-import { test } from 'uvu';
-import * as assert from 'uvu/assert';
+import { expect, test } from 'vitest';
import { validate_config } from '../../core/config/index.js';
import { posixify } from '../../utils/filesystem.js';
import { get_config_aliases } from './utils.js';
@@ -29,7 +28,7 @@ test('transform kit.alias to resolve.alias', () => {
};
});
- assert.equal(transformed, [
+ expect(transformed).toEqual([
{ find: '$lib', replacement: 'src/lib' },
{ find: 'simpleKey', replacement: 'simple/value' },
{ find: /^key$/.toString(), replacement: 'value' },
@@ -38,5 +37,3 @@ test('transform kit.alias to resolve.alias', () => {
{ find: /^\$regexChar\/(.+)$/.toString(), replacement: 'windows/path/$1' }
]);
});
-
-test.run();
diff --git a/packages/kit/src/runtime/server/cookie.spec.js b/packages/kit/src/runtime/server/cookie.spec.js
index d121a3022e40..b8ab71e73996 100644
--- a/packages/kit/src/runtime/server/cookie.spec.js
+++ b/packages/kit/src/runtime/server/cookie.spec.js
@@ -1,5 +1,4 @@
-import { test } from 'uvu';
-import * as assert from 'uvu/assert';
+import { assert, expect, test } from 'vitest';
import { domain_matches, path_matches, get_cookies } from './cookie.js';
import { installPolyfills } from '../../exports/node/polyfills.js';
@@ -41,7 +40,7 @@ paths.positive.forEach(([path, constraint]) => {
paths.negative.forEach(([path, constraint]) => {
test(`! ${path} / ${constraint}`, () => {
- assert.not(path_matches(path, constraint));
+ assert.isFalse(path_matches(path, constraint));
});
});
@@ -60,9 +59,9 @@ const cookies_setup = ({ href, headers } = {}) => {
test('a cookie should not be present after it is deleted', () => {
const { cookies } = cookies_setup();
cookies.set('a', 'b');
- assert.equal(cookies.get('a'), 'b');
+ expect(cookies.get('a')).toEqual('b');
cookies.delete('a');
- assert.not(cookies.get('a'));
+ assert.isNotOk(cookies.get('a'));
});
test('default values when set is called', () => {
@@ -183,13 +182,13 @@ test('warns if cookie exceeds 4,129 bytes', () => {
test('get all cookies from header and set calls', () => {
const { cookies } = cookies_setup();
- assert.equal(cookies.getAll(), [{ name: 'a', value: 'b' }]);
+ expect(cookies.getAll()).toEqual([{ name: 'a', value: 'b' }]);
cookies.set('a', 'foo');
cookies.set('a', 'bar');
cookies.set('b', 'baz');
- assert.equal(cookies.getAll(), [
+ expect(cookies.getAll()).toEqual([
{ name: 'a', value: 'bar' },
{ name: 'b', value: 'baz' }
]);
@@ -199,15 +198,16 @@ test("set_internal isn't affected by defaults", () => {
const { cookies, new_cookies, set_internal } = cookies_setup({
href: 'https://example.com/a/b/c'
});
+
const options = /** @type {const} */ ({
secure: false,
httpOnly: false,
sameSite: 'none',
path: '/a/b/c'
});
+
set_internal('test', 'foo', options);
- assert.equal(cookies.get('test'), 'foo');
- assert.equal(new_cookies['test']?.options, options);
-});
-test.run();
+ expect(cookies.get('test')).toEqual('foo');
+ expect(new_cookies['test']?.options).toEqual(options);
+});
diff --git a/packages/kit/src/runtime/server/page/crypto.spec.js b/packages/kit/src/runtime/server/page/crypto.spec.js
index f4d840ed9904..5ef48af42300 100644
--- a/packages/kit/src/runtime/server/page/crypto.spec.js
+++ b/packages/kit/src/runtime/server/page/crypto.spec.js
@@ -1,6 +1,5 @@
import { webcrypto } from 'node:crypto';
-import { test } from 'uvu';
-import * as assert from 'uvu/assert';
+import { assert, test } from 'vitest';
import { sha256 } from './crypto.js';
const inputs = [
@@ -23,5 +22,3 @@ inputs.forEach((input) => {
assert.equal(actual, expected);
});
});
-
-test.run();
diff --git a/packages/kit/src/runtime/server/page/csp.spec.js b/packages/kit/src/runtime/server/page/csp.spec.js
index 41411a408217..9747053dae67 100644
--- a/packages/kit/src/runtime/server/page/csp.spec.js
+++ b/packages/kit/src/runtime/server/page/csp.spec.js
@@ -1,12 +1,11 @@
import { webcrypto } from 'node:crypto';
-import { test } from 'uvu';
-import * as assert from 'uvu/assert';
+import { assert, beforeAll, test } from 'vitest';
import { Csp } from './csp.js';
// @ts-expect-error
globalThis.crypto = webcrypto;
-test.before(() => {
+beforeAll(() => {
// @ts-expect-error
globalThis.__SVELTEKIT_DEV__ = false;
});
@@ -273,5 +272,3 @@ test('throws when reportOnly contains directives but no report-uri or report-to'
);
}, '`content-security-policy-report-only` must be specified with either the `report-to` or `report-uri` directives, or both');
});
-
-test.run();
diff --git a/packages/kit/src/runtime/server/page/load_data.spec.js b/packages/kit/src/runtime/server/page/load_data.spec.js
index 224401e295ef..88785b4a7b98 100644
--- a/packages/kit/src/runtime/server/page/load_data.spec.js
+++ b/packages/kit/src/runtime/server/page/load_data.spec.js
@@ -1,5 +1,4 @@
-import { test } from 'uvu';
-import * as assert from 'uvu/assert';
+import { assert, expect, test } from 'vitest';
import { create_universal_fetch } from './load_data.js';
/**
@@ -48,17 +47,13 @@ test('succeeds when acao header present on cors', async () => {
test('errors when no acao header present on cors', async () => {
const fetch = create_fetch({});
- try {
+
+ expect(async () => {
const response = await fetch('https://domain-b.com');
await response.text();
- assert.unreachable('should have thrown cors error');
- } catch (e) {
- assert.ok(e instanceof Error);
- assert.match(
- e.message,
- /CORS error: No 'Access-Control-Allow-Origin' header is present on the requested resource/
- );
- }
+ }).rejects.toThrowError(
+ "CORS error: No 'Access-Control-Allow-Origin' header is present on the requested resource"
+ );
});
test('errors when trying to access non-serialized request headers on the server', async () => {
@@ -69,5 +64,3 @@ test('errors when trying to access non-serialized request headers on the server'
/Failed to get response header "content-type" — it must be included by the `filterSerializedResponseHeaders` option/
);
});
-
-test.run();
diff --git a/packages/kit/src/runtime/server/page/serialize_data.spec.js b/packages/kit/src/runtime/server/page/serialize_data.spec.js
index 1868337108f4..550cf7e0814c 100644
--- a/packages/kit/src/runtime/server/page/serialize_data.spec.js
+++ b/packages/kit/src/runtime/server/page/serialize_data.spec.js
@@ -1,5 +1,4 @@
-import { test } from 'uvu';
-import * as assert from 'uvu/assert';
+import { assert, test } from 'vitest';
import { serialize_data } from './serialize_data.js';
test('escapes slashes', () => {
@@ -102,5 +101,3 @@ test('doesnt compute ttl when vary header is present', () => {
``
);
});
-
-test.run();
diff --git a/packages/kit/src/utils/escape.spec.js b/packages/kit/src/utils/escape.spec.js
index 4c65852809ea..15d3bfe62f0a 100644
--- a/packages/kit/src/utils/escape.spec.js
+++ b/packages/kit/src/utils/escape.spec.js
@@ -1,5 +1,4 @@
-import { test } from 'uvu';
-import * as assert from 'uvu/assert';
+import { assert, test } from 'vitest';
import { escape_html_attr } from './escape.js';
test('escape_html_attr escapes special attribute characters', () => {
@@ -18,5 +17,3 @@ test('escape_html_attr escapes invalid surrogates', () => {
assert.equal(escape_html_attr('\ud800\udc00\udc00'), '"\ud800\udc00"');
assert.equal(escape_html_attr('\ud800\ud800\udc00\udc00'), '"\ud800\udc00"');
});
-
-test.run();
diff --git a/packages/kit/src/utils/exports.spec.js b/packages/kit/src/utils/exports.spec.js
index fbbdf0be46a5..ed82d5ee5e31 100644
--- a/packages/kit/src/utils/exports.spec.js
+++ b/packages/kit/src/utils/exports.spec.js
@@ -1,5 +1,4 @@
-import { test } from 'uvu';
-import * as assert from 'uvu/assert';
+import { assert, test } from 'vitest';
import {
validate_layout_exports,
validate_layout_server_exports,
@@ -175,5 +174,3 @@ test('validates +server.js', () => {
});
}, `Invalid export 'csr' ('csr' is a valid export in +layout.js, +page.js, +layout.server.js or +page.server.js)`);
});
-
-test.run();
diff --git a/packages/kit/src/utils/filesystem.spec.js b/packages/kit/src/utils/filesystem.spec.js
index 7814616b72a1..27ff9c49a49f 100644
--- a/packages/kit/src/utils/filesystem.spec.js
+++ b/packages/kit/src/utils/filesystem.spec.js
@@ -1,18 +1,15 @@
import { mkdtempSync, writeFileSync, readdirSync, mkdirSync, readFileSync } from 'node:fs';
import { tmpdir } from 'node:os';
import { dirname, join } from 'node:path';
-import { suite } from 'uvu';
-import * as assert from 'uvu/assert';
+import { assert, expect, beforeEach, test } from 'vitest';
import { copy, mkdirp } from './filesystem.js';
-const suite_copy = suite('#copy()');
-
/** @type {string} */
let source_dir;
/** @type {string} */
let dest_dir;
-suite_copy.before.each(() => {
+beforeEach(() => {
const temp_dir = mkdtempSync(join(tmpdir(), 'kit-core-filesystem-'));
source_dir = join(temp_dir, 'source');
dest_dir = join(temp_dir, 'dest');
@@ -30,7 +27,7 @@ const write = (file, contents) => {
writeFileSync(filepath, contents);
};
-suite_copy('without filter', () => {
+test('without filter', () => {
write('file-one.js', '');
write('file-two.css', '');
write('file-three', '');
@@ -39,10 +36,10 @@ suite_copy('without filter', () => {
const copied = readdirSync(dest_dir);
- assert.equal(copied.sort(), ['file-one.js', 'file-two.css', 'file-three'].sort());
+ expect(copied.sort()).toEqual(['file-one.js', 'file-two.css', 'file-three'].sort());
});
-suite_copy('filters out subdirectory contents', () => {
+test('filters out subdirectory contents', () => {
write('file-one.js', '');
write('file-two.css', '');
write('no-copy/do-not-copy.js', '');
@@ -53,10 +50,10 @@ suite_copy('filters out subdirectory contents', () => {
const copied = readdirSync(dest_dir);
- assert.equal(copied.sort(), ['file-one.js', 'file-two.css'].sort());
+ expect(copied.sort()).toEqual(['file-one.js', 'file-two.css'].sort());
});
-suite_copy('copies recursively', () => {
+test('copies recursively', () => {
write('file-one.js', '');
write('file-two.css', '');
write('deep/a.js', '');
@@ -66,27 +63,29 @@ suite_copy('copies recursively', () => {
const root = readdirSync(dest_dir);
- assert.equal(root.sort(), ['file-one.js', 'file-two.css', 'deep'].sort());
+ expect(root.sort()).toEqual(['file-one.js', 'file-two.css', 'deep'].sort());
const subdir = readdirSync(join(dest_dir, 'deep'));
- assert.equal(subdir.sort(), ['a.js', 'b.js'].sort());
+ expect(subdir.sort()).toEqual(['a.js', 'b.js'].sort());
});
-suite_copy('returns a list of copied files', () => {
+test('returns a list of copied files', () => {
write('file-one.js', '');
write('file-two.css', '');
write('deep/a.js', '');
write('deep/b.js', '');
let file_list = copy(source_dir, dest_dir);
- assert.equal(file_list.sort(), ['file-one.js', 'file-two.css', 'deep/a.js', 'deep/b.js'].sort());
+ expect(file_list.sort()).toEqual(
+ ['file-one.js', 'file-two.css', 'deep/a.js', 'deep/b.js'].sort()
+ );
file_list = copy(`${source_dir}/file-one.js`, `${dest_dir}/file-one-renamed.js`);
- assert.equal(file_list, ['file-one-renamed.js']);
+ expect(file_list).toEqual(['file-one-renamed.js']);
});
-suite_copy('replaces strings', () => {
+test('replaces strings', () => {
write('foo.md', 'the quick brown JUMPER jumps over the lazy JUMPEE');
copy(source_dir, dest_dir, {
replace: {
@@ -100,5 +99,3 @@ suite_copy('replaces strings', () => {
'the quick brown fox jumps over the lazy dog'
);
});
-
-suite_copy.run();
diff --git a/packages/kit/src/utils/http.spec.js b/packages/kit/src/utils/http.spec.js
index 38e968f82f6d..c46c0e921e28 100644
--- a/packages/kit/src/utils/http.spec.js
+++ b/packages/kit/src/utils/http.spec.js
@@ -1,5 +1,4 @@
-import { test } from 'uvu';
-import * as assert from 'uvu/assert';
+import { assert, test } from 'vitest';
import { negotiate } from './http.js';
test('handle valid accept header value', () => {
@@ -11,5 +10,3 @@ test('handle invalid accept header value', () => {
const accept = 'text/html,*';
assert.equal(negotiate(accept, ['text/html']), 'text/html');
});
-
-test.run();
diff --git a/packages/kit/src/utils/routing.spec.js b/packages/kit/src/utils/routing.spec.js
index 3f37ca83c6c2..027dd37c8ce5 100644
--- a/packages/kit/src/utils/routing.spec.js
+++ b/packages/kit/src/utils/routing.spec.js
@@ -1,5 +1,4 @@
-import { test } from 'uvu';
-import * as assert from 'uvu/assert';
+import { assert, expect, test } from 'vitest';
import { exec, parse_route_id, resolve_entry } from './routing.js';
const tests = {
@@ -57,8 +56,8 @@ for (const [key, expected] of Object.entries(tests)) {
test(`parse_route_id: "${key}"`, () => {
const actual = parse_route_id(key);
- assert.equal(actual.pattern.toString(), expected.pattern.toString());
- assert.equal(actual.params, expected.params);
+ expect(actual.pattern.toString()).toEqual(expected.pattern.toString());
+ expect(actual.params).toEqual(expected.params);
});
}
@@ -214,7 +213,7 @@ for (const { path, route, expected } of exec_tests) {
matches: () => true,
doesntmatch: () => false
});
- assert.equal(actual, expected);
+ expect(actual).toEqual(expected);
});
}
@@ -259,9 +258,8 @@ for (const { route, entry, expected } of from_entry_tests) {
}
test('resolve_entry errors on missing entry for required param', () => {
- assert.throws(
- () => resolve_entry('/blog/[one]/[two]', { one: 'one' }),
- "Missing param 'two' in route /blog/[one]/[two]"
+ expect(() => resolve_entry('/blog/[one]/[two]', { one: 'one' })).toThrow(
+ "Missing parameter 'two' in route /blog/[one]/[two]"
);
});
@@ -275,5 +273,3 @@ test('resolve_entry errors on entry values starting or ending with slashes', ()
"Parameter 'two' in route /blog/[one]/[two] cannot start or end with a slash -- this would cause an invalid route like foo//bar"
);
});
-
-test.run();
diff --git a/packages/kit/src/utils/streaming.spec.js b/packages/kit/src/utils/streaming.spec.js
index ccee5a99fa87..97ba7722fc0f 100644
--- a/packages/kit/src/utils/streaming.spec.js
+++ b/packages/kit/src/utils/streaming.spec.js
@@ -1,5 +1,4 @@
-import { test } from 'uvu';
-import * as assert from 'uvu/assert';
+import { expect, test } from 'vitest';
import { create_async_iterator } from './streaming.js';
test(`works with fast consecutive promise resolutions`, async () => {
@@ -14,7 +13,5 @@ test(`works with fast consecutive promise resolutions`, async () => {
actual.push(value);
}
- assert.equal(actual, [1, 2]);
+ expect(actual).toEqual([1, 2]);
});
-
-test.run();
diff --git a/packages/kit/src/utils/unit_test.js b/packages/kit/src/utils/unit_test.js
deleted file mode 100644
index eca30f1b4f35..000000000000
--- a/packages/kit/src/utils/unit_test.js
+++ /dev/null
@@ -1,11 +0,0 @@
-import { suite } from 'uvu';
-
-/**
- * @param {string} name
- * @param {(suite: import('uvu').Test) => void} fn
- */
-export function describe(name, fn) {
- const s = suite(name);
- fn(s);
- s.run();
-}
diff --git a/packages/kit/src/utils/url.spec.js b/packages/kit/src/utils/url.spec.js
index 6960df947431..166448227f2c 100644
--- a/packages/kit/src/utils/url.spec.js
+++ b/packages/kit/src/utils/url.spec.js
@@ -1,5 +1,4 @@
-import * as assert from 'uvu/assert';
-import { describe } from './unit_test.js';
+import { assert, describe } from 'vitest';
import { resolve, normalize_path, make_trackable, disable_search } from './url.js';
describe('resolve', (test) => {
@@ -100,7 +99,7 @@ describe('make_trackable', (test) => {
});
url.origin;
- assert.not(tracked);
+ assert.isNotOk(tracked);
url.pathname;
assert.ok(tracked);
@@ -126,7 +125,7 @@ describe('disable_search', (test) => {
props.forEach((prop) => {
assert.throws(
() => url[prop],
- 'Cannot access url.search on a page with prerendering enabled'
+ `Cannot access url.${prop} on a page with prerendering enabled`
);
});
});
diff --git a/packages/kit/test/build-errors/env.spec.js b/packages/kit/test/build-errors/env.spec.js
index 929d32136478..02efbf296dc9 100644
--- a/packages/kit/test/build-errors/env.spec.js
+++ b/packages/kit/test/build-errors/env.spec.js
@@ -1,5 +1,4 @@
-import { test } from 'uvu';
-import * as assert from 'uvu/assert';
+import { assert, test } from 'vitest';
import { execSync } from 'node:child_process';
import path from 'node:path';
@@ -50,5 +49,3 @@ test('$env/static/private is not dynamically importable from the client', () =>
/.*Cannot import \0\$env\/static\/private into client-side code:.*/gs
);
});
-
-test.run();
diff --git a/packages/kit/test/build-errors/package.json b/packages/kit/test/build-errors/package.json
index 849aa371b34d..6a187d508a87 100644
--- a/packages/kit/test/build-errors/package.json
+++ b/packages/kit/test/build-errors/package.json
@@ -3,11 +3,11 @@
"private": true,
"version": "0.0.0-next.0",
"scripts": {
- "test": "uvu . \"(spec\\.js|test[\\\\/]index\\.js)\"",
- "test:cross-platform:build": "uvu . \"(spec\\.js|test[\\\\/]index\\.js)\""
+ "test": "vitest run",
+ "test:cross-platform:build": "vitest run"
},
"type": "module",
"devDependencies": {
- "uvu": "^0.5.6"
+ "vitest": "^0.31.0"
}
}
diff --git a/packages/kit/test/build-errors/prerender.spec.js b/packages/kit/test/build-errors/prerender.spec.js
index 743e311754bb..9aab65e6a795 100644
--- a/packages/kit/test/build-errors/prerender.spec.js
+++ b/packages/kit/test/build-errors/prerender.spec.js
@@ -1,7 +1,7 @@
-import { test } from 'uvu';
-import * as assert from 'uvu/assert';
+import { assert, test } from 'vitest';
import { execSync } from 'node:child_process';
import path from 'node:path';
+import { EOL } from 'node:os';
test('prerenderable routes must be prerendered', () => {
assert.throws(
@@ -23,13 +23,6 @@ test('entry generators should match their own route', () => {
stdio: 'pipe',
timeout: 60000
}),
- /** @param {Error} err */ (err) =>
- err.message
- .replace(/\r\n/g, '\n')
- .includes(
- 'Error: The entries export from /[slug]/[notSpecific] generated entry /whatever/specific, which was matched by /[slug]/specific - see the `handleEntryGeneratorMismatch` option in https://kit.svelte.dev/docs/configuration#prerender for more info.\nTo suppress or handle this error, implement `handleEntryGeneratorMismatch` in https://kit.svelte.dev/docs/configuration#prerender'
- )
+ `Error: The entries export from /[slug]/[notSpecific] generated entry /whatever/specific, which was matched by /[slug]/specific - see the \`handleEntryGeneratorMismatch\` option in https://kit.svelte.dev/docs/configuration#prerender for more info.${EOL}To suppress or handle this error, implement \`handleEntryGeneratorMismatch\` in https://kit.svelte.dev/docs/configuration#prerender`
);
});
-
-test.run();
diff --git a/packages/kit/test/build-errors/server-only.spec.js b/packages/kit/test/build-errors/server-only.spec.js
index c84ca3bb52a5..62e5ca789d87 100644
--- a/packages/kit/test/build-errors/server-only.spec.js
+++ b/packages/kit/test/build-errors/server-only.spec.js
@@ -1,5 +1,4 @@
-import { test } from 'uvu';
-import * as assert from 'uvu/assert';
+import { assert, test } from 'vitest';
import { execSync } from 'node:child_process';
import path from 'node:path';
@@ -17,7 +16,7 @@ test('$lib/*.server.* is not statically importable from the client', () => {
);
return;
}
- assert.unreachable();
+ throw new Error();
});
test('$lib/*.server.* is not dynamically importable from the client', () => {
@@ -34,7 +33,7 @@ test('$lib/*.server.* is not dynamically importable from the client', () => {
);
return;
}
- assert.unreachable();
+ throw new Error();
});
test('$lib/server/* is not statically importable from the client', () => {
@@ -51,7 +50,7 @@ test('$lib/server/* is not statically importable from the client', () => {
);
return;
}
- assert.unreachable();
+ throw new Error();
});
test('$lib/server/* is not dynamically importable from the client', () => {
@@ -68,7 +67,5 @@ test('$lib/server/* is not dynamically importable from the client', () => {
);
return;
}
- assert.unreachable();
+ throw new Error();
});
-
-test.run();
diff --git a/packages/kit/test/build-errors/syntax-error.js b/packages/kit/test/build-errors/syntax-error.spec.js
similarity index 81%
rename from packages/kit/test/build-errors/syntax-error.js
rename to packages/kit/test/build-errors/syntax-error.spec.js
index 51e8eac11b72..dd481bf2bb2e 100644
--- a/packages/kit/test/build-errors/syntax-error.js
+++ b/packages/kit/test/build-errors/syntax-error.spec.js
@@ -1,5 +1,4 @@
-import { test } from 'uvu';
-import * as assert from 'uvu/assert';
+import { assert, test } from 'vitest';
import { execSync } from 'node:child_process';
import path from 'node:path';
@@ -17,7 +16,5 @@ test('$lib/*.server.* is not statically importable from the client', () => {
);
return;
}
- assert.unreachable();
+ throw new Error();
});
-
-test.run();
diff --git a/packages/kit/test/prerendering/basics/package.json b/packages/kit/test/prerendering/basics/package.json
index 06387e933c3c..bdcdac932074 100644
--- a/packages/kit/test/prerendering/basics/package.json
+++ b/packages/kit/test/prerendering/basics/package.json
@@ -7,7 +7,7 @@
"build": "vite build",
"preview": "vite preview",
"check": "svelte-kit sync && tsc && svelte-check",
- "test": "svelte-kit sync && pnpm build && uvu test",
+ "test": "svelte-kit sync && pnpm build && vitest run",
"test:cross-platform": "pnpm test"
},
"devDependencies": {
@@ -15,8 +15,8 @@
"svelte": "^3.56.0",
"svelte-check": "^3.0.2",
"typescript": "^4.9.4",
- "uvu": "^0.5.6",
- "vite": "^4.3.0"
+ "vite": "^4.3.0",
+ "vitest": "^0.31.0"
},
"type": "module"
}
diff --git a/packages/kit/test/prerendering/basics/test/test.js b/packages/kit/test/prerendering/basics/test/tests.spec.js
similarity index 81%
rename from packages/kit/test/prerendering/basics/test/test.js
rename to packages/kit/test/prerendering/basics/test/tests.spec.js
index 9604856215c9..145f69364109 100644
--- a/packages/kit/test/prerendering/basics/test/test.js
+++ b/packages/kit/test/prerendering/basics/test/tests.spec.js
@@ -1,7 +1,6 @@
import * as fs from 'node:fs';
import { fileURLToPath } from 'node:url';
-import { test } from 'uvu';
-import * as assert from 'uvu/assert';
+import { assert, expect, test } from 'vitest';
const build = fileURLToPath(new URL('../build', import.meta.url));
@@ -10,7 +9,7 @@ const read = (file, encoding = 'utf-8') => fs.readFileSync(`${build}/${file}`, e
test('prerenders /', () => {
const content = read('index.html');
- assert.match(content, 'hello
');
+ expect(content).toMatch('hello
');
});
test('renders a redirect', () => {
@@ -27,7 +26,7 @@ test('renders a server-side redirect', () => {
const data = JSON.parse(read('redirect-server/__data.json'));
- assert.equal(data, {
+ expect(data).toEqual({
type: 'redirect',
location: 'https://example.com/redirected'
});
@@ -51,12 +50,12 @@ test('escapes characters in redirect', () => {
test('inserts http-equiv tag for cache-control headers', () => {
const content = read('max-age.html');
- assert.match(content, '');
+ expect(content).toMatch('');
});
test('renders page with data from endpoint', () => {
const content = read('fetch-endpoint/buffered.html');
- assert.match(content, 'the answer is 42
');
+ expect(content).toMatch('the answer is 42
');
const json = read('fetch-endpoint/buffered.json');
assert.equal(json, JSON.stringify({ answer: 42 }));
@@ -64,7 +63,7 @@ test('renders page with data from endpoint', () => {
test('renders page with unbuffered data from endpoint', () => {
const content = read('fetch-endpoint/not-buffered.html');
- assert.match(content, 'content-type: application/json
');
+ expect(content).toMatch('content-type: application/json
');
const json = read('fetch-endpoint/not-buffered.json');
assert.equal(json, JSON.stringify({ answer: 42 }));
@@ -72,12 +71,12 @@ test('renders page with unbuffered data from endpoint', () => {
test('loads a file with spaces in the filename', () => {
const content = read('load-file-with-spaces.html');
- assert.match(content, 'answer: 42
');
+ expect(content).toMatch('answer: 42
');
});
test('generates __data.json file for shadow endpoints', () => {
let data = JSON.parse(read('__data.json'));
- assert.equal(data, {
+ expect(data).toEqual({
type: 'data',
nodes: [
null,
@@ -90,7 +89,7 @@ test('generates __data.json file for shadow endpoints', () => {
});
data = JSON.parse(read('shadowed-get/__data.json'));
- assert.equal(data, {
+ expect(data).toEqual({
type: 'data',
nodes: [
null,
@@ -104,30 +103,27 @@ test('generates __data.json file for shadow endpoints', () => {
});
test('does not prerender page with shadow endpoint with non-load handler', () => {
- assert.not(fs.existsSync(`${build}/shadowed-post.html`));
- assert.not(fs.existsSync(`${build}/shadowed-post/__data.json`));
+ assert.isFalse(fs.existsSync(`${build}/shadowed-post.html`));
+ assert.isFalse(fs.existsSync(`${build}/shadowed-post/__data.json`));
});
test('decodes paths when writing files', () => {
let content = read('encoding/path with spaces.html');
- assert.match(content, 'path with spaces
');
- assert.match(content, 'path with encoded spaces
');
+ expect(content).toMatch('path with spaces
');
+ expect(content).toMatch('path with encoded spaces
');
content = read('encoding/dynamic path with spaces.html');
- assert.match(
- content,
+ expect(content).toMatch(
'dynamic path with spaces / /encoding/dynamic%20path%20with%20spaces
'
);
content = read('encoding/dynamic path with encoded spaces.html');
- assert.match(
- content,
+ expect(content).toMatch(
'dynamic path with encoded spaces / /encoding/dynamic%20path%20with%20encoded%20spaces
'
);
content = read('encoding/redirected path with encoded spaces.html');
- assert.match(
- content,
+ expect(content).toMatch(
'redirected path with encoded spaces / /encoding/redirected%20path%20with%20encoded%20spaces
'
);
@@ -140,12 +136,12 @@ test('decodes paths when writing files', () => {
test('prerendering is set to true in root +layout.js', () => {
const content = read('prerendering-true.html');
- assert.match(content, 'prerendering: true/true
');
+ expect(content).toMatch('prerendering: true/true
');
});
test('fetching missing content results in a 404', () => {
const content = read('fetch-404.html');
- assert.match(content, 'status: 404
');
+ expect(content).toMatch('status: 404
');
});
test('prerenders binary data', async () => {
@@ -156,7 +152,7 @@ test('prerenders binary data', async () => {
test('fetches data from local endpoint', () => {
const data = JSON.parse(read('origin/__data.json'));
- assert.equal(data, {
+ expect(data).toEqual({
type: 'data',
nodes: [
null,
@@ -174,7 +170,7 @@ test('fetches data from local endpoint', () => {
test('respects config.prerender.origin', () => {
const content = read('origin.html');
- assert.match(content, 'http://example.com
');
+ expect(content).toMatch('http://example.com
');
});
test('$env - includes environment variables', () => {
@@ -194,17 +190,17 @@ test('$env - includes environment variables', () => {
test('prerenders a page in a (group)', () => {
const content = read('grouped.html');
- assert.match(content, 'grouped
');
+ expect(content).toMatch('grouped
');
});
test('injects relative service worker', () => {
const content = read('index.html');
- assert.match(content, `navigator.serviceWorker.register('./service-worker.js')`);
+ expect(content).toMatch(`navigator.serviceWorker.register('./service-worker.js')`);
});
test('define service worker variables', () => {
const content = read('service-worker.js');
- assert.match(content, `MY_ENV DEFINED`);
+ expect(content).toMatch(`MY_ENV DEFINED`);
});
test('prerendered.paths omits trailing slashes for endpoints', () => {
@@ -215,8 +211,6 @@ test('prerendered.paths omits trailing slashes for endpoints', () => {
'/trailing-slash/page/__data.json',
'/trailing-slash/standalone-endpoint.json'
]) {
- assert.match(content, `"${path}"`, `Missing ${path}`);
+ expect(content, `Missing ${path}`).toMatch(`"${path}"`);
}
});
-
-test.run();
diff --git a/packages/kit/test/prerendering/options/package.json b/packages/kit/test/prerendering/options/package.json
index b46d853c474b..37594889d19d 100644
--- a/packages/kit/test/prerendering/options/package.json
+++ b/packages/kit/test/prerendering/options/package.json
@@ -7,15 +7,15 @@
"build": "vite build",
"preview": "vite preview",
"check": "svelte-kit sync && tsc && svelte-check",
- "test": "svelte-kit sync && pnpm build && uvu test"
+ "test": "svelte-kit sync && pnpm build && vitest run"
},
"devDependencies": {
"@sveltejs/kit": "workspace:^",
"svelte": "^3.56.0",
"svelte-check": "^3.0.2",
"typescript": "^4.9.4",
- "uvu": "^0.5.6",
- "vite": "^4.3.0"
+ "vite": "^4.3.0",
+ "vitest": "^0.31.0"
},
"type": "module"
}
diff --git a/packages/kit/test/prerendering/options/test/test.js b/packages/kit/test/prerendering/options/test/tests.spec.js
similarity index 72%
rename from packages/kit/test/prerendering/options/test/test.js
rename to packages/kit/test/prerendering/options/test/tests.spec.js
index 3d81d7539672..afea5a0e14de 100644
--- a/packages/kit/test/prerendering/options/test/test.js
+++ b/packages/kit/test/prerendering/options/test/tests.spec.js
@@ -1,7 +1,6 @@
import * as fs from 'node:fs';
import { fileURLToPath } from 'node:url';
-import { test } from 'uvu';
-import * as assert from 'uvu/assert';
+import { assert, expect, test } from 'vitest';
const build = fileURLToPath(new URL('../build', import.meta.url));
@@ -10,34 +9,31 @@ const read = (file) => fs.readFileSync(`${build}/${file}`, 'utf-8');
test('prerenders /path-base', () => {
const content = read('index.html');
- assert.match(content, 'hello
');
+ expect(content).toMatch('hello
');
});
test('prerenders nested /path-base', () => {
const content = read('nested/index.html');
- assert.match(content, 'nested hello
');
+ expect(content).toMatch('nested hello
');
});
test('adds CSP headers via meta tag', () => {
const content = read('index.html');
- assert.match(
- content,
+ expect(content).toMatch(
' {
const content = read('assets.html');
assert.match(content, /]+src="\/path-base\//u);
});
-
-test.run();
diff --git a/packages/migrate/migrations/package/migrate_config.spec.js b/packages/migrate/migrations/package/migrate_config.spec.js
index e640d1db1d2c..d352cf036e3b 100644
--- a/packages/migrate/migrations/package/migrate_config.spec.js
+++ b/packages/migrate/migrations/package/migrate_config.spec.js
@@ -1,5 +1,4 @@
-import { test } from 'uvu';
-import * as assert from 'uvu/assert';
+import { assert, test } from 'vitest';
import { remove_package_from_config } from './migrate_config.js';
test('Removes package config #1', () => {
@@ -77,5 +76,3 @@ test('Leaves config untouched', () => {
const result = remove_package_from_config(content);
assert.equal(result, content);
});
-
-test.run();
diff --git a/packages/migrate/migrations/package/migrate_pkg.spec.js b/packages/migrate/migrations/package/migrate_pkg.spec.js
index 43e0db640d27..993d0e83331f 100644
--- a/packages/migrate/migrations/package/migrate_pkg.spec.js
+++ b/packages/migrate/migrations/package/migrate_pkg.spec.js
@@ -1,5 +1,4 @@
-import { test } from 'uvu';
-import * as assert from 'uvu/assert';
+import { expect, test } from 'vitest';
import { update_pkg_json } from './migrate_pkg.js';
test('Updates package.json', () => {
@@ -61,7 +60,7 @@ test('Updates package.json', () => {
}
]
);
- assert.equal(JSON.parse(JSON.stringify(result)), {
+ expect(JSON.parse(JSON.stringify(result))).toEqual({
name: 'foo',
version: '1.0.0',
type: 'module',
@@ -136,7 +135,7 @@ test('Updates package.json #2', () => {
}
]
);
- assert.equal(JSON.parse(JSON.stringify(result)), {
+ expect(JSON.parse(JSON.stringify(result))).toEqual({
name: 'foo',
version: '1.0.0',
type: 'module',
@@ -156,5 +155,3 @@ test('Updates package.json #2', () => {
svelte: './dist/index.js'
});
});
-
-test.run();
diff --git a/packages/migrate/migrations/routes/migrate_page_js/index.spec.js b/packages/migrate/migrations/routes/migrate_page_js/index.spec.js
index 48b543509920..5e698e739dc1 100644
--- a/packages/migrate/migrations/routes/migrate_page_js/index.spec.js
+++ b/packages/migrate/migrations/routes/migrate_page_js/index.spec.js
@@ -1,6 +1,5 @@
+import { assert, test } from 'vitest';
import { read_samples } from '../utils.js';
-import { test } from 'uvu';
-import * as assert from 'uvu/assert';
import { migrate_page } from './index.js';
for (const sample of read_samples(import.meta.url)) {
@@ -9,5 +8,3 @@ for (const sample of read_samples(import.meta.url)) {
assert.equal(actual, sample.after);
});
}
-
-test.run();
diff --git a/packages/migrate/migrations/routes/migrate_page_server/index.spec.js b/packages/migrate/migrations/routes/migrate_page_server/index.spec.js
index 2fef6827be62..e3a4611ccb31 100644
--- a/packages/migrate/migrations/routes/migrate_page_server/index.spec.js
+++ b/packages/migrate/migrations/routes/migrate_page_server/index.spec.js
@@ -1,6 +1,5 @@
+import { assert, test } from 'vitest';
import { read_samples } from '../utils.js';
-import { test } from 'uvu';
-import * as assert from 'uvu/assert';
import { migrate_page_server } from './index.js';
for (const sample of read_samples(import.meta.url)) {
@@ -9,5 +8,3 @@ for (const sample of read_samples(import.meta.url)) {
assert.equal(actual, sample.after);
});
}
-
-test.run();
diff --git a/packages/migrate/migrations/routes/migrate_scripts/index.spec.js b/packages/migrate/migrations/routes/migrate_scripts/index.spec.js
index f26c1f1cdb08..38f9ebcf612a 100644
--- a/packages/migrate/migrations/routes/migrate_scripts/index.spec.js
+++ b/packages/migrate/migrations/routes/migrate_scripts/index.spec.js
@@ -1,6 +1,5 @@
+import { assert, test } from 'vitest';
import { read_samples } from '../utils.js';
-import { test } from 'uvu';
-import * as assert from 'uvu/assert';
import { migrate_scripts } from './index.js';
for (const sample of read_samples(import.meta.url)) {
@@ -13,5 +12,3 @@ for (const sample of read_samples(import.meta.url)) {
assert.equal(actual.main, sample.after);
});
}
-
-test.run();
diff --git a/packages/migrate/migrations/routes/migrate_server/index.spec.js b/packages/migrate/migrations/routes/migrate_server/index.spec.js
index 2dbf77031063..188ba33b6ae0 100644
--- a/packages/migrate/migrations/routes/migrate_server/index.spec.js
+++ b/packages/migrate/migrations/routes/migrate_server/index.spec.js
@@ -1,6 +1,5 @@
+import { assert, test } from 'vitest';
import { read_samples } from '../utils.js';
-import { test } from 'uvu';
-import * as assert from 'uvu/assert';
import { migrate_server } from './index.js';
for (const sample of read_samples(import.meta.url)) {
@@ -9,5 +8,3 @@ for (const sample of read_samples(import.meta.url)) {
assert.equal(actual, sample.after);
});
}
-
-test.run();
diff --git a/packages/migrate/package.json b/packages/migrate/package.json
index 39e238638ed6..ac4b2bfc226d 100644
--- a/packages/migrate/package.json
+++ b/packages/migrate/package.json
@@ -31,12 +31,13 @@
"typescript": "^4.9.4"
},
"devDependencies": {
+ "@types/node": "^16.18.6",
"@types/prompts": "^2.4.1",
"prettier": "^2.8.0",
- "uvu": "^0.5.6"
+ "vitest": "^0.31.0"
},
"scripts": {
- "test": "uvu",
+ "test": "vitest run",
"check": "tsc"
}
}
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 4c95c8cf5a61..217361c7c5a8 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -155,9 +155,9 @@ importers:
typescript:
specifier: ^4.9.4
version: 4.9.4
- uvu:
- specifier: ^0.5.6
- version: 0.5.6
+ vitest:
+ specifier: ^0.31.0
+ version: 0.31.0(playwright@1.30.0)
packages/adapter-node:
dependencies:
@@ -198,9 +198,9 @@ importers:
typescript:
specifier: ^4.9.4
version: 4.9.4
- uvu:
- specifier: ^0.5.6
- version: 0.5.6
+ vitest:
+ specifier: ^0.31.0
+ version: 0.31.0(playwright@1.30.0)
packages/adapter-static:
devDependencies:
@@ -277,9 +277,9 @@ importers:
typescript:
specifier: ^4.9.4
version: 4.9.4
- uvu:
- specifier: ^0.5.6
- version: 0.5.6
+ vitest:
+ specifier: ^0.31.0
+ version: 0.31.0(playwright@1.30.0)
packages/amp:
dependencies:
@@ -439,12 +439,12 @@ importers:
typescript:
specifier: ^4.9.4
version: 4.9.4
- uvu:
- specifier: ^0.5.6
- version: 0.5.6
vite:
specifier: ^4.3.0
version: 4.3.0(@types/node@16.18.6)
+ vitest:
+ specifier: ^0.31.0
+ version: 0.31.0(playwright@1.30.0)
packages/kit/test/apps/amp:
devDependencies:
@@ -610,9 +610,9 @@ importers:
packages/kit/test/build-errors:
devDependencies:
- uvu:
- specifier: ^0.5.6
- version: 0.5.6
+ vitest:
+ specifier: ^0.31.0
+ version: 0.31.0(playwright@1.30.0)
packages/kit/test/build-errors/apps/prerender-entry-generator-mismatch:
devDependencies:
@@ -856,12 +856,12 @@ importers:
typescript:
specifier: ^4.9.4
version: 4.9.4
- uvu:
- specifier: ^0.5.6
- version: 0.5.6
vite:
specifier: ^4.3.0
version: 4.3.0(@types/node@16.18.6)
+ vitest:
+ specifier: ^0.31.0
+ version: 0.31.0(playwright@1.30.0)
packages/kit/test/prerendering/options:
devDependencies:
@@ -877,12 +877,12 @@ importers:
typescript:
specifier: ^4.9.4
version: 4.9.4
- uvu:
- specifier: ^0.5.6
- version: 0.5.6
vite:
specifier: ^4.3.0
version: 4.3.0(@types/node@16.18.6)
+ vitest:
+ specifier: ^0.31.0
+ version: 0.31.0(playwright@1.30.0)
packages/kit/test/prerendering/paths-base:
devDependencies:
@@ -898,12 +898,12 @@ importers:
typescript:
specifier: ^4.9.4
version: 4.9.4
- uvu:
- specifier: ^0.5.6
- version: 0.5.6
vite:
specifier: ^4.3.0
version: 4.3.0(@types/node@16.18.6)
+ vitest:
+ specifier: ^0.31.0
+ version: 0.31.0(playwright@1.30.0)
packages/migrate:
dependencies:
@@ -923,15 +923,18 @@ importers:
specifier: ^4.9.4
version: 4.9.4
devDependencies:
+ '@types/node':
+ specifier: ^16.18.6
+ version: 16.18.6
'@types/prompts':
specifier: ^2.4.1
version: 2.4.1
prettier:
specifier: ^2.8.0
version: 2.8.0
- uvu:
- specifier: ^0.5.6
- version: 0.5.6
+ vitest:
+ specifier: ^0.31.0
+ version: 0.31.0(playwright@1.30.0)
packages/package:
dependencies:
@@ -1021,15 +1024,15 @@ importers:
typescript:
specifier: ^4.9.4
version: 4.9.4
- uvu:
- specifier: ^0.5.6
- version: 0.5.6
vite:
specifier: ^4.3.0
version: 4.3.0(@types/node@16.18.6)
vite-imagetools:
specifier: ^4.0.19
version: 4.0.19(rollup@3.7.0)
+ vitest:
+ specifier: ^0.31.0
+ version: 0.31.0(playwright@1.30.0)
packages:
@@ -1731,6 +1734,16 @@ packages:
- encoding
dev: true
+ /@types/chai-subset@1.3.3:
+ resolution: {integrity: sha512-frBecisrNGz+F4T6bcc+NLeolfiojh5FxW2klu669+8BARtyQv2C/GkNW6FUodVe4BroGMP/wER/YDGc7rEllw==}
+ dependencies:
+ '@types/chai': 4.3.5
+ dev: true
+
+ /@types/chai@4.3.5:
+ resolution: {integrity: sha512-mEo1sAde+UCE6b2hxn332f1g1E8WfYRu6p5SvTKr2ZKC1f7gFJXk4h5PyGP9Dt6gCaG8y8XhwnXWC6Iy2cmBng==}
+ dev: true
+
/@types/connect@3.4.35:
resolution: {integrity: sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==}
dependencies:
@@ -2065,22 +2078,73 @@ packages:
- supports-color
dev: false
+ /@vitest/expect@0.31.0:
+ resolution: {integrity: sha512-Jlm8ZTyp6vMY9iz9Ny9a0BHnCG4fqBa8neCF6Pk/c/6vkUk49Ls6UBlgGAU82QnzzoaUs9E/mUhq/eq9uMOv/g==}
+ dependencies:
+ '@vitest/spy': 0.31.0
+ '@vitest/utils': 0.31.0
+ chai: 4.3.7
+ dev: true
+
+ /@vitest/runner@0.31.0:
+ resolution: {integrity: sha512-H1OE+Ly7JFeBwnpHTrKyCNm/oZgr+16N4qIlzzqSG/YRQDATBYmJb/KUn3GrZaiQQyL7GwpNHVZxSQd6juLCgw==}
+ dependencies:
+ '@vitest/utils': 0.31.0
+ concordance: 5.0.4
+ p-limit: 4.0.0
+ pathe: 1.1.0
+ dev: true
+
+ /@vitest/snapshot@0.31.0:
+ resolution: {integrity: sha512-5dTXhbHnyUMTMOujZPB0wjFjQ6q5x9c8TvAsSPUNKjp1tVU7i9pbqcKPqntyu2oXtmVxKbuHCqrOd+Ft60r4tg==}
+ dependencies:
+ magic-string: 0.30.0
+ pathe: 1.1.0
+ pretty-format: 27.5.1
+ dev: true
+
+ /@vitest/spy@0.31.0:
+ resolution: {integrity: sha512-IzCEQ85RN26GqjQNkYahgVLLkULOxOm5H/t364LG0JYb3Apg0PsYCHLBYGA006+SVRMWhQvHlBBCyuByAMFmkg==}
+ dependencies:
+ tinyspy: 2.1.0
+ dev: true
+
+ /@vitest/utils@0.31.0:
+ resolution: {integrity: sha512-kahaRyLX7GS1urekRXN2752X4gIgOGVX4Wo8eDUGUkTWlGpXzf5ZS6N9RUUS+Re3XEE8nVGqNyxkSxF5HXlGhQ==}
+ dependencies:
+ concordance: 5.0.4
+ loupe: 2.3.6
+ pretty-format: 27.5.1
+ dev: true
+
/abbrev@1.1.1:
resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==}
dev: false
- /acorn-jsx@5.3.2(acorn@8.8.1):
+ /acorn-jsx@5.3.2(acorn@8.8.2):
resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==}
peerDependencies:
acorn: ^6.0.0 || ^7.0.0 || ^8.0.0
dependencies:
- acorn: 8.8.1
+ acorn: 8.8.2
+ dev: true
+
+ /acorn-walk@8.2.0:
+ resolution: {integrity: sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==}
+ engines: {node: '>=0.4.0'}
dev: true
/acorn@8.8.1:
resolution: {integrity: sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA==}
engines: {node: '>=0.4.0'}
hasBin: true
+ dev: false
+
+ /acorn@8.8.2:
+ resolution: {integrity: sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==}
+ engines: {node: '>=0.4.0'}
+ hasBin: true
+ dev: true
/agent-base@6.0.2:
resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==}
@@ -2133,6 +2197,11 @@ packages:
color-convert: 2.0.1
dev: true
+ /ansi-styles@5.2.0:
+ resolution: {integrity: sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==}
+ engines: {node: '>=10'}
+ dev: true
+
/any-promise@1.3.0:
resolution: {integrity: sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==}
dev: true
@@ -2186,6 +2255,10 @@ packages:
engines: {node: '>=0.10.0'}
dev: true
+ /assertion-error@1.1.0:
+ resolution: {integrity: sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==}
+ dev: true
+
/async-sema@3.1.1:
resolution: {integrity: sha512-tLRNUXati5MFePdAk8dw7Qt7DpxPB60ofAgn8WRhW6a2rcimZnYBP9oxHiv0OHy+Wz7kPMG+t4LGdt31+4EmGg==}
dev: false
@@ -2228,6 +2301,10 @@ packages:
readable-stream: 3.6.0
dev: true
+ /blueimp-md5@2.19.0:
+ resolution: {integrity: sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w==}
+ dev: true
+
/brace-expansion@1.1.11:
resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==}
dependencies:
@@ -2292,6 +2369,11 @@ packages:
yargs-parser: 20.2.9
dev: true
+ /cac@6.7.14:
+ resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==}
+ engines: {node: '>=8'}
+ dev: true
+
/call-bind@1.0.2:
resolution: {integrity: sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==}
dependencies:
@@ -2323,6 +2405,19 @@ packages:
engines: {node: '>=6'}
dev: true
+ /chai@4.3.7:
+ resolution: {integrity: sha512-HLnAzZ2iupm25PlN0xFreAlBA5zaBSv3og0DdeGA4Ar6h6rJ3A0rolRUKJhSF2V10GZKDgWF/VmAEsNWjCRB+A==}
+ engines: {node: '>=4'}
+ dependencies:
+ assertion-error: 1.1.0
+ check-error: 1.0.2
+ deep-eql: 4.1.3
+ get-func-name: 2.0.0
+ loupe: 2.3.6
+ pathval: 1.1.1
+ type-detect: 4.0.8
+ dev: true
+
/chalk@2.4.2:
resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==}
engines: {node: '>=4'}
@@ -2344,6 +2439,10 @@ packages:
resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==}
dev: true
+ /check-error@1.0.2:
+ resolution: {integrity: sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA==}
+ dev: true
+
/chokidar@3.5.3:
resolution: {integrity: sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==}
engines: {node: '>= 8.10.0'}
@@ -2490,6 +2589,20 @@ packages:
/concat-map@0.0.1:
resolution: {integrity: sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=}
+ /concordance@5.0.4:
+ resolution: {integrity: sha512-OAcsnTEYu1ARJqWVGwf4zh4JDfHZEaSNlNccFmt8YjB2l/n19/PF2viLINHc57vO4FKIAFl2FWASIGZZWZ2Kxw==}
+ engines: {node: '>=10.18.0 <11 || >=12.14.0 <13 || >=14'}
+ dependencies:
+ date-time: 3.1.0
+ esutils: 2.0.3
+ fast-diff: 1.2.0
+ js-string-escape: 1.0.1
+ lodash: 4.17.21
+ md5-hex: 3.0.1
+ semver: 7.5.0
+ well-known-symbols: 2.0.0
+ dev: true
+
/console-clear@1.1.1:
resolution: {integrity: sha512-pMD+MVR538ipqkG5JXeOEbKWS5um1H4LUUccUQG68qpeqBYbzYy79Gh55jkd2TtPdRfUaLWdv6LPP//5Zt0aPQ==}
engines: {node: '>=4'}
@@ -2596,6 +2709,13 @@ packages:
resolution: {integrity: sha512-68s5jYdlvasItOJnCuI2Q9s4q98g0pCyL3HrcKJu8KNugUl8ahgmZYg38ysLTgQjjXX3H8CJLkAvWrclWfcalw==}
dev: true
+ /date-time@3.1.0:
+ resolution: {integrity: sha512-uqCUKXE5q1PNBXjPqvwhwJf9SwMoAHBgWJ6DcrnS5o+W2JOiIILl0JEdVD8SGujrNS02GGxgwAg2PN2zONgtjg==}
+ engines: {node: '>=6'}
+ dependencies:
+ time-zone: 1.0.0
+ dev: true
+
/debug@4.3.4:
resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==}
engines: {node: '>=6.0'}
@@ -2636,6 +2756,13 @@ packages:
resolution: {integrity: sha512-OUepMozQULMLUmhxS95Vudo0jb0UchLimi3+pQ2plj61Fcy8axbP9hbiD4Sz6DPqn6XG3kfmziVfQ1rSys5AJQ==}
dev: false
+ /deep-eql@4.1.3:
+ resolution: {integrity: sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==}
+ engines: {node: '>=6'}
+ dependencies:
+ type-detect: 4.0.8
+ dev: true
+
/deep-extend@0.6.0:
resolution: {integrity: sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==}
engines: {node: '>=4.0.0'}
@@ -2950,8 +3077,8 @@ packages:
resolution: {integrity: sha512-XwctdmTO6SIvCzd9810yyNzIrOrqNYV9Koizx4C/mRhf9uq0o4yHoCEU/670pOxOL/MSraektvSAji79kX90Vg==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
dependencies:
- acorn: 8.8.1
- acorn-jsx: 5.3.2(acorn@8.8.1)
+ acorn: 8.8.2
+ acorn-jsx: 5.3.2(acorn@8.8.2)
eslint-visitor-keys: 3.4.0
dev: true
@@ -3035,6 +3162,10 @@ packages:
resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==}
dev: true
+ /fast-diff@1.2.0:
+ resolution: {integrity: sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==}
+ dev: true
+
/fast-glob@3.2.12:
resolution: {integrity: sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==}
engines: {node: '>=8.6.0'}
@@ -3211,6 +3342,10 @@ packages:
engines: {node: 6.* || 8.* || >= 10.*}
dev: true
+ /get-func-name@2.0.0:
+ resolution: {integrity: sha512-Hm0ixYtaSZ/V7C8FJrtZIuBBI+iSgL+1Aq82zSu8VQNB4S3Gk8e7Qs3VwBDJAhmRZcFqkl3tQu36g/Foh5I5ig==}
+ dev: true
+
/get-intrinsic@1.1.3:
resolution: {integrity: sha512-QJVz1Tj7MS099PevUG5jvnt9tSkXN8K14dxQlikJuPt4uD9hHAHjLyLBiLR5zELelBdD9QNRAXZzsJx0WaDL9A==}
dependencies:
@@ -3688,6 +3823,11 @@ packages:
resolution: {integrity: sha512-mifzlm2+5nZ+lEcLJMoBK0/IH/bDg8XnJfd/Wq6IP+xoCjLZsTOnV2QpxlVbX9bMnkl5PdEjNtBJ9Cj1NjifhQ==}
dev: true
+ /js-string-escape@1.0.1:
+ resolution: {integrity: sha512-Smw4xcfIQ5LVjAOuJCvN/zIodzA/BBSsluuoSykP+lUvScIi4U6RJLfwHet5cxFnCswUjISV8oAXaqaJDY3chg==}
+ engines: {node: '>= 0.8'}
+ dev: true
+
/js-tokens@4.0.0:
resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==}
dev: true
@@ -3798,6 +3938,11 @@ packages:
engines: {node: '>=6'}
dev: true
+ /local-pkg@0.4.3:
+ resolution: {integrity: sha512-SFppqq5p42fe2qcZQqqEOiVRXl+WCP1MdT6k7BDEW1j++sp5fIY+/fdRQitvKgB5BrBcmrs5m/L0v2FrU5MY1g==}
+ engines: {node: '>=14'}
+ dev: true
+
/locate-path@2.0.0:
resolution: {integrity: sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA==}
engines: {node: '>=4'}
@@ -3832,6 +3977,12 @@ packages:
resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==}
dev: true
+ /loupe@2.3.6:
+ resolution: {integrity: sha512-RaPMZKiMy8/JruncMU5Bt6na1eftNoo++R4Y+N2FrxkDVTrGvcyzFTsaGif4QTeKESheMGegbhw6iUAq+5A8zA==}
+ dependencies:
+ get-func-name: 2.0.0
+ dev: true
+
/lower-case@2.0.2:
resolution: {integrity: sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==}
dependencies:
@@ -3895,6 +4046,13 @@ packages:
hasBin: true
dev: true
+ /md5-hex@3.0.1:
+ resolution: {integrity: sha512-BUiRtTtV39LIJwinWBjqVsU9xhdnz7/i889V859IBFpuqGAj6LuOvHv5XLbgZ2R7ptJoJaEcxkv88/h25T7Ciw==}
+ engines: {node: '>=8'}
+ dependencies:
+ blueimp-md5: 2.19.0
+ dev: true
+
/mem@1.1.0:
resolution: {integrity: sha512-nOBDrc/wgpkd3X/JOhMqYR+/eLqlfLP4oQfoBA6QExIxEl+GU01oyEkwWyueyO8110pUKijtiHGhEmYoOn88oQ==}
engines: {node: '>=4'}
@@ -4024,6 +4182,15 @@ packages:
hasBin: true
dev: false
+ /mlly@1.2.0:
+ resolution: {integrity: sha512-+c7A3CV0KGdKcylsI6khWyts/CYrGTrRVo4R/I7u/cUsy0Conxa6LUhiEzVKIw14lc2L5aiO4+SeVe4TeGRKww==}
+ dependencies:
+ acorn: 8.8.2
+ pathe: 1.1.0
+ pkg-types: 1.0.3
+ ufo: 1.1.2
+ dev: true
+
/mri@1.2.0:
resolution: {integrity: sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==}
engines: {node: '>=4'}
@@ -4227,6 +4394,13 @@ packages:
yocto-queue: 0.1.0
dev: true
+ /p-limit@4.0.0:
+ resolution: {integrity: sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==}
+ engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
+ dependencies:
+ yocto-queue: 1.0.0
+ dev: true
+
/p-locate@2.0.0:
resolution: {integrity: sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg==}
engines: {node: '>=4'}
@@ -4341,6 +4515,14 @@ packages:
engines: {node: '>=8'}
dev: true
+ /pathe@1.1.0:
+ resolution: {integrity: sha512-ODbEPR0KKHqECXW1GoxdDb+AZvULmXjVPy4rt+pGo2+TnjJTIPJQSVS6N63n8T2Ip+syHhbn52OewKicV0373w==}
+ dev: true
+
+ /pathval@1.1.1:
+ resolution: {integrity: sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==}
+ dev: true
+
/picocolors@1.0.0:
resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==}
@@ -4370,6 +4552,14 @@ packages:
find-up: 4.1.0
dev: true
+ /pkg-types@1.0.3:
+ resolution: {integrity: sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A==}
+ dependencies:
+ jsonc-parser: 3.2.0
+ mlly: 1.2.0
+ pathe: 1.1.0
+ dev: true
+
/playwright-core@1.30.0:
resolution: {integrity: sha512-7AnRmTCf+GVYhHbLJsGUtskWTE33SwMZkybJ0v6rqR1boxq2x36U7p1vDRV7HO2IwTZgmycracLxPEJI49wu4g==}
engines: {node: '>=14'}
@@ -4456,6 +4646,15 @@ packages:
hasBin: true
dev: true
+ /pretty-format@27.5.1:
+ resolution: {integrity: sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==}
+ engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0}
+ dependencies:
+ ansi-regex: 5.0.1
+ ansi-styles: 5.2.0
+ react-is: 17.0.2
+ dev: true
+
/prism-svelte@0.5.0:
resolution: {integrity: sha512-db91Bf3pRGKDPz1lAqLFSJXeW13mulUJxhycysFpfXV5MIK7RgWWK2E5aPAa71s8TCzQUXxF5JOV42/iOs6QkA==}
dev: true
@@ -4519,6 +4718,10 @@ packages:
strip-json-comments: 2.0.1
dev: true
+ /react-is@17.0.2:
+ resolution: {integrity: sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==}
+ dev: true
+
/read-pkg-up@2.0.0:
resolution: {integrity: sha512-1orxQfbWGUiTn9XsPlChs6rLie/AV9jwZTGmu2NZw/CUDJQchXJFYE0Fq5j7+n558T1JhDWLdhyd1Zj+wLY//w==}
engines: {node: '>=4'}
@@ -4853,6 +5056,10 @@ packages:
object-inspect: 1.12.2
dev: true
+ /siginfo@2.0.0:
+ resolution: {integrity: sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==}
+ dev: true
+
/signal-exit@3.0.7:
resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==}
@@ -4997,6 +5204,14 @@ packages:
resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==}
dev: true
+ /stackback@0.0.2:
+ resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==}
+ dev: true
+
+ /std-env@3.3.3:
+ resolution: {integrity: sha512-Rz6yejtVyWnVjC1RFvNmYL10kgjC49EOghxWn0RFqlCHGFpQx+Xe7yW3I4ceK1SGrWIGMjD5Kbue8W/udkbMJg==}
+ dev: true
+
/stream-transform@2.1.3:
resolution: {integrity: sha512-9GHUiM5hMiCi6Y03jD2ARC1ettBXkQBoQAe7nJsPknnI0ow10aXjTnew8QtYQmLjzn974BnmWEAJgCY6ZP1DeQ==}
dependencies:
@@ -5101,6 +5316,12 @@ packages:
engines: {node: '>=8'}
dev: true
+ /strip-literal@1.0.1:
+ resolution: {integrity: sha512-QZTsipNpa2Ppr6v1AmJHESqJ3Uz247MUS0OjrnnZjFAvEoWqxuyFuXn2xLgMtRnijJShAa1HL0gtJyUs7u7n3Q==}
+ dependencies:
+ acorn: 8.8.2
+ dev: true
+
/sucrase@3.29.0:
resolution: {integrity: sha512-bZPAuGA5SdFHuzqIhTAqt9fvNEo9rESqXIG3oiKdF8K4UmkQxC4KlNL3lVyAErXp+mPvUqZ5l13qx6TrDIGf3A==}
engines: {node: '>=8'}
@@ -5303,17 +5524,36 @@ packages:
any-promise: 1.3.0
dev: true
+ /time-zone@1.0.0:
+ resolution: {integrity: sha512-TIsDdtKo6+XrPtiTm1ssmMngN1sAhyKnTO2kunQWqNPWIVvCm15Wmw4SWInwTVgJ5u/Tr04+8Ei9TNcw4x4ONA==}
+ engines: {node: '>=4'}
+ dev: true
+
/tiny-glob@0.2.9:
resolution: {integrity: sha512-g/55ssRPUjShh+xkfx9UPDXqhckHEsHr4Vd9zX55oSdGZc/MD0m3sferOkwWtp98bv+kcVfEHtRJgBVJzelrzg==}
dependencies:
globalyzer: 0.1.0
globrex: 0.1.2
+ /tinybench@2.5.0:
+ resolution: {integrity: sha512-kRwSG8Zx4tjF9ZiyH4bhaebu+EDz1BOx9hOigYHlUW4xxI/wKIUQUqo018UlU4ar6ATPBsaMrdbKZ+tmPdohFA==}
+ dev: true
+
/tinydate@1.3.0:
resolution: {integrity: sha512-7cR8rLy2QhYHpsBDBVYnnWXm8uRTr38RoZakFSW7Bs7PzfMPNZthuMLkwqZv7MTu8lhQ91cOFYS5a7iFj2oR3w==}
engines: {node: '>=4'}
dev: true
+ /tinypool@0.5.0:
+ resolution: {integrity: sha512-paHQtnrlS1QZYKF/GnLoOM/DN9fqaGOFbCbxzAhwniySnzl9Ebk8w73/dd34DAhe/obUbPAOldTyYXQZxnPBPQ==}
+ engines: {node: '>=14.0.0'}
+ dev: true
+
+ /tinyspy@2.1.0:
+ resolution: {integrity: sha512-7eORpyqImoOvkQJCSkL0d0mB4NHHIFAy4b1u8PHdDa7SjGS2njzl6/lyGoZLm+eyYEtlUmFGE0rFj66SWxZgQQ==}
+ engines: {node: '>=14.0.0'}
+ dev: true
+
/tmp@0.0.33:
resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==}
engines: {node: '>=0.6.0'}
@@ -5402,6 +5642,11 @@ packages:
prelude-ls: 1.2.1
dev: true
+ /type-detect@4.0.8:
+ resolution: {integrity: sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==}
+ engines: {node: '>=4'}
+ dev: true
+
/type-fest@0.13.1:
resolution: {integrity: sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==}
engines: {node: '>=10'}
@@ -5433,6 +5678,10 @@ packages:
hasBin: true
dev: true
+ /ufo@1.1.2:
+ resolution: {integrity: sha512-TrY6DsjTQQgyS3E3dBaOXf0TpPD8u9FVrVYmKVegJuFw51n/YB9XPt+U6ydzFG5ZIN7+DIjPbNmXoBj9esYhgQ==}
+ dev: true
+
/uglify-js@3.17.4:
resolution: {integrity: sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==}
engines: {node: '>=0.8.0'}
@@ -5511,6 +5760,27 @@ packages:
- rollup
dev: true
+ /vite-node@0.31.0(@types/node@16.18.6):
+ resolution: {integrity: sha512-8x1x1LNuPvE2vIvkSB7c1mApX5oqlgsxzHQesYF7l5n1gKrEmrClIiZuOFbFDQcjLsmcWSwwmrWrcGWm9Fxc/g==}
+ engines: {node: '>=v14.18.0'}
+ hasBin: true
+ dependencies:
+ cac: 6.7.14
+ debug: 4.3.4
+ mlly: 1.2.0
+ pathe: 1.1.0
+ picocolors: 1.0.0
+ vite: 4.3.0(@types/node@16.18.6)
+ transitivePeerDependencies:
+ - '@types/node'
+ - less
+ - sass
+ - stylus
+ - sugarss
+ - supports-color
+ - terser
+ dev: true
+
/vite@4.3.0(@types/node@16.18.6):
resolution: {integrity: sha512-JTGFgDh3dVxeGBpuQX04Up+JZmuG6wu9414Ei36vQzaEruY/M4K0AgwtuB2b4HaBgB7R8l+LHxjB0jcgz4d2qQ==}
engines: {node: ^14.18.0 || >=16.0.0}
@@ -5554,6 +5824,72 @@ packages:
vite: 4.3.0(@types/node@16.18.6)
dev: false
+ /vitest@0.31.0(playwright@1.30.0):
+ resolution: {integrity: sha512-JwWJS9p3GU9GxkG7eBSmr4Q4x4bvVBSswaCFf1PBNHiPx00obfhHRJfgHcnI0ffn+NMlIh9QGvG75FlaIBdKGA==}
+ engines: {node: '>=v14.18.0'}
+ hasBin: true
+ peerDependencies:
+ '@edge-runtime/vm': '*'
+ '@vitest/browser': '*'
+ '@vitest/ui': '*'
+ happy-dom: '*'
+ jsdom: '*'
+ playwright: '*'
+ safaridriver: '*'
+ webdriverio: '*'
+ peerDependenciesMeta:
+ '@edge-runtime/vm':
+ optional: true
+ '@vitest/browser':
+ optional: true
+ '@vitest/ui':
+ optional: true
+ happy-dom:
+ optional: true
+ jsdom:
+ optional: true
+ playwright:
+ optional: true
+ safaridriver:
+ optional: true
+ webdriverio:
+ optional: true
+ dependencies:
+ '@types/chai': 4.3.5
+ '@types/chai-subset': 1.3.3
+ '@types/node': 16.18.6
+ '@vitest/expect': 0.31.0
+ '@vitest/runner': 0.31.0
+ '@vitest/snapshot': 0.31.0
+ '@vitest/spy': 0.31.0
+ '@vitest/utils': 0.31.0
+ acorn: 8.8.2
+ acorn-walk: 8.2.0
+ cac: 6.7.14
+ chai: 4.3.7
+ concordance: 5.0.4
+ debug: 4.3.4
+ local-pkg: 0.4.3
+ magic-string: 0.30.0
+ pathe: 1.1.0
+ picocolors: 1.0.0
+ playwright: 1.30.0
+ std-env: 3.3.3
+ strip-literal: 1.0.1
+ tinybench: 2.5.0
+ tinypool: 0.5.0
+ vite: 4.3.0(@types/node@16.18.6)
+ vite-node: 0.31.0(@types/node@16.18.6)
+ why-is-node-running: 2.2.2
+ transitivePeerDependencies:
+ - less
+ - sass
+ - stylus
+ - sugarss
+ - supports-color
+ - terser
+ dev: true
+
/vscode-oniguruma@1.6.2:
resolution: {integrity: sha512-KH8+KKov5eS/9WhofZR8M8dMHWN2gTxjMsG4jd04YhpbPR91fUj7rYQ2/XjeHCJWbg7X++ApRIU9NUwM2vTvLA==}
dev: true
@@ -5571,6 +5907,11 @@ packages:
/webidl-conversions@3.0.1:
resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==}
+ /well-known-symbols@2.0.0:
+ resolution: {integrity: sha512-ZMjC3ho+KXo0BfJb7JgtQ5IBuvnShdlACNkKkdsqBmYw3bPAaJfPeYUo6tLUaT5tG/Gkh7xkpBhKRQ9e7pyg9Q==}
+ engines: {node: '>=6'}
+ dev: true
+
/whatwg-url@5.0.0:
resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==}
dependencies:
@@ -5614,6 +5955,15 @@ packages:
isexe: 2.0.0
dev: true
+ /why-is-node-running@2.2.2:
+ resolution: {integrity: sha512-6tSwToZxTOcotxHeA+qGCq1mVzKR3CwcJGmVcY+QE8SHy6TnpFnh8PAvPNHYr7EcuVeG0QSMxtYCuO1ta/G/oA==}
+ engines: {node: '>=8'}
+ hasBin: true
+ dependencies:
+ siginfo: 2.0.0
+ stackback: 0.0.2
+ dev: true
+
/wide-align@1.1.5:
resolution: {integrity: sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==}
dependencies:
@@ -5771,3 +6121,8 @@ packages:
resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==}
engines: {node: '>=10'}
dev: true
+
+ /yocto-queue@1.0.0:
+ resolution: {integrity: sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==}
+ engines: {node: '>=12.20'}
+ dev: true
diff --git a/sites/kit.svelte.dev/package.json b/sites/kit.svelte.dev/package.json
index f419d7f934f2..ad78727901f7 100644
--- a/sites/kit.svelte.dev/package.json
+++ b/sites/kit.svelte.dev/package.json
@@ -8,7 +8,7 @@
"build": "npm run update && vite build",
"prebuild": "test \"$CI\" = true && npx pnpm install --store=node_modules/.pnpm-store || echo skipping pnpm install",
"preview": "vite preview",
- "test": "uvu src \"(spec\\.js|test[\\\\/]index\\.js)\""
+ "test": "vitest run"
},
"devDependencies": {
"@sveltejs/adapter-vercel": "workspace:^",
@@ -26,9 +26,9 @@
"svelte": "^3.56.0",
"tiny-glob": "^0.2.9",
"typescript": "^4.9.4",
- "uvu": "^0.5.6",
"vite": "^4.3.0",
- "vite-imagetools": "^4.0.19"
+ "vite-imagetools": "^4.0.19",
+ "vitest": "^0.31.0"
},
"type": "module",
"dependencies": {
diff --git a/sites/kit.svelte.dev/src/lib/docs/server/index.spec.js b/sites/kit.svelte.dev/src/lib/docs/server/index.spec.js
index 7c40bcd7fda5..a5f12d630eea 100644
--- a/sites/kit.svelte.dev/src/lib/docs/server/index.spec.js
+++ b/sites/kit.svelte.dev/src/lib/docs/server/index.spec.js
@@ -1,5 +1,4 @@
-import { test } from 'uvu';
-import * as assert from 'uvu/assert';
+import { assert, test } from 'vitest';
import { generate_ts_from_js } from './index.js';
/**
@@ -227,5 +226,3 @@ etc etc
`
);
});
-
-test.run();