Skip to content

Commit 6846b91

Browse files
authored
Merge pull request #225 from c4dt/110-bis
set up Vitest and disable Bun's test runner
2 parents c506c24 + 5e13962 commit 6846b91

File tree

8 files changed

+113
-23
lines changed

8 files changed

+113
-23
lines changed

.github/workflows/CI.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ jobs:
3030
uses: oven-sh/setup-bun@v2
3131
- run: bun install
3232
- name: Run tests
33-
run: bun test
33+
run: bun vitest

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,11 @@ devbox run playwright:test-ui
7777

7878
to run it in a GUI.
7979

80+
### MacOS
81+
82+
If you're running Playwright on macOS, the command-line tests are currently flaky, but running
83+
in a GUI seems to yield consistent results.
84+
8085
## Production
8186

8287
Build the application for production:

bun.lock

Lines changed: 80 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bunfig.toml

Lines changed: 0 additions & 2 deletions
This file was deleted.

nuxt.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// https://nuxt.com/docs/api/configuration/nuxt-config
22
import tailwindcss from "@tailwindcss/vite";
3+
import { defineNuxtConfig } from "nuxt/config";
34

45
export default defineNuxtConfig({
56
compatibilityDate: "2025-03-09",

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"format": "prettier --check .",
1515
"format:fix": "prettier --write .",
1616
"prepare": "husky",
17-
"test": "vitest --run",
17+
"vitest": "vitest --run",
1818
"playwright:test": "playwright test",
1919
"playwright:test-ui": "playwright test --ui"
2020
},
@@ -28,6 +28,7 @@
2828
"@nuxt/test-utils": "^3.19.2",
2929
"@tailwindcss/vite": "^4.1.16",
3030
"@vesp/nuxt-fontawesome": "^1.2.1",
31+
"@vue/test-utils": "^2.4.6",
3132
"ajv": "^8.17.1",
3233
"eslint-config-prettier": "^10.1.8",
3334
"husky": "^9.1.7",
@@ -38,6 +39,7 @@
3839
"prettier": "^3.6.2",
3940
"prettier-plugin-tailwindcss": "^0.6.14",
4041
"tailwindcss": "^4.1.16",
42+
"vitest": "^4.0.2",
4143
"vue": "^3.5.22",
4244
"vue3-carousel": "^0.14.0",
4345
"yaml": "^2.8.1"
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { test } from "bun:test";
2-
import { loadProjects } from "~/utils/loadData";
1+
import { test } from "vitest";
2+
import { loadProjects } from "../utils/loadData";
33

44
test("Verifies that projects data conform to schema", async () => {
55
await loadProjects();

vitest.config.ts

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
1-
import { defineVitestConfig } from "@nuxt/test-utils/config";
1+
import { defineConfig } from "vitest/config";
2+
import { defineVitestProject } from "@nuxt/test-utils/config";
23

3-
export default defineVitestConfig({
4-
// any custom Vitest config you require
4+
export default defineConfig({
5+
test: {
6+
projects: [
7+
{
8+
test: {
9+
name: "unit",
10+
include: ["test/*.{test,spec}.ts"],
11+
environment: "node"
12+
}
13+
},
14+
await defineVitestProject({
15+
test: {
16+
name: "nuxt",
17+
include: ["test/nuxt/*.{test,spec}.ts"],
18+
environment: "nuxt"
19+
}
20+
})
21+
]
22+
}
523
});

0 commit comments

Comments
 (0)