Skip to content

Commit 2664f16

Browse files
committed
Clean away Ava
This removes Ava from the monorepo as Vitest is now used for all javascript tests. This also adds a cleanup hook as running the tests locally could leave multiple instances of Node running in the background.
1 parent 6302bfe commit 2664f16

File tree

4 files changed

+9
-771
lines changed

4 files changed

+9
-771
lines changed

api/node/__test__/eventloop.spec.mts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,15 @@
33

44
// Test that the Slint event loop processes libuv's events.
55

6-
import { test, expect } from "vitest";
6+
import { test, expect, afterEach } from "vitest";
77
import * as http from "node:http";
88

99
import { runEventLoop, quitEventLoop, private_api } from "../dist/index.js";
1010

11+
afterEach(() => {
12+
quitEventLoop();
13+
});
14+
1115
test.sequential("merged event loops with timer", async () => {
1216
let invoked = false;
1317

api/node/package.json

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,9 @@
2020
],
2121
"description": "Slint is a declarative GUI toolkit to build native user interfaces for desktop and embedded applications.",
2222
"devDependencies": {
23-
"@ava/typescript": "6.0.0",
2423
"@biomejs/biome": "catalog:",
2524
"@types/capture-console": "1.0.5",
2625
"@types/node": "catalog:",
27-
"ava": "6.4.1",
2826
"capture-console": "1.0.2",
2927
"jimp": "1.6.0",
3028
"typedoc": "0.28.14",
@@ -50,30 +48,6 @@
5048
"lint:fix": "biome lint --fix",
5149
"test": "vitest run"
5250
},
53-
"ava": {
54-
"typescript": {
55-
"rewritePaths": {
56-
"__test__/": "build/"
57-
},
58-
"compile": false,
59-
"extensions": [
60-
"mts"
61-
]
62-
},
63-
"timeout": "2m",
64-
"workerThreads": false,
65-
"files": [
66-
"**/*.spec.mts",
67-
"!**/window.spec.mts",
68-
"!**/types.spec.mts",
69-
"!**/models.spec.mts",
70-
"!**/globals.spec.mts",
71-
"!**/compiler.spec.mts",
72-
"!**/api.spec.mts",
73-
"!**/js_value_conversion.spec.mts",
74-
"!**/eventloop.spec.mts"
75-
]
76-
},
7751
"dependencies": {
7852
"@napi-rs/cli": "2.18.4",
7953
"strip-ansi": "7.1.2"

api/node/vitest.config.ts

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,10 @@ import { defineConfig } from "vitest/config";
55

66
export default defineConfig({
77
test: {
8-
include: [
9-
"**/window.spec.mts",
10-
"**/types.spec.mts",
11-
"**/models.spec.mts",
12-
"**/globals.spec.mts",
13-
"**/compiler.spec.mts",
14-
"**/api.spec.mts",
15-
"**/js_value_conversion.spec.mts",
16-
"**/eventloop.spec.mts",
17-
],
8+
include: ["**/*.spec.mts"],
189
globals: true, // Enable global test/expect/describe
19-
isolate: true, // Use separate processes for isolation (matching ava's workerThreads: false)
20-
reporters: ["verbose"], // Show individual test names (similar to Ava output)
10+
pool: "forks", // Use process forks (required for native modules that need main thread)
11+
teardownTimeout: 5000, // Force teardown after 5s to prevent hanging processes
12+
reporters: ["verbose"], // Show individual test names
2113
},
2214
});

0 commit comments

Comments
 (0)