Adjust tests to use vitest + jsdom

This commit is contained in:
Schluffe
2026-08-08 18:35:57 +02:00
parent ae8c63ce11
commit 9bdffd06e4
20 changed files with 196 additions and 150 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
import { expect, test } from "bun:test";
import { expect, test } from "vitest";
import { add, scale, sub, vec } from "./vector.ts";
test("vec builds a vector", () => {
@@ -1,4 +1,4 @@
import { expect, test } from "bun:test";
import { expect, test } from "vitest";
import { vec } from "./given.ts";
import { dot, length, normalize } from "./mathv.ts";
+1 -1
View File
@@ -1,4 +1,4 @@
import { expect, test } from "bun:test";
import { expect, test } from "vitest";
import { vec } from "./given.ts";
import { integrate } from "./motion.ts";
+1 -1
View File
@@ -1,4 +1,4 @@
import { expect, test } from "bun:test";
import { expect, test } from "vitest";
import { type AABB, aabbOverlap, pointInAABB } from "./aabb.ts";
const box: AABB = { x: 10, y: 10, w: 20, h: 20 }; // spans 10..30 in both axes
+1 -1
View File
@@ -1,4 +1,4 @@
import { expect, test } from "bun:test";
import { expect, test } from "vitest";
import { sweepInterval } from "./sweep1d.ts";
test("moving right into the interval", () => {
+1 -1
View File
@@ -1,4 +1,4 @@
import { expect, test } from "bun:test";
import { expect, test } from "vitest";
import { type AABB, vec } from "./given.ts";
import { rayVsAABB } from "./ray.ts";
+1 -1
View File
@@ -1,4 +1,4 @@
import { expect, test } from "bun:test";
import { expect, test } from "vitest";
import { type AABB, vec } from "./given.ts";
import { sweptAABB } from "./swept.ts";
+1 -1
View File
@@ -1,4 +1,4 @@
import { expect, test } from "bun:test";
import { expect, test } from "vitest";
import { vec } from "./given.ts";
import { resolve } from "./resolve.ts";
+1 -1
View File
@@ -1,4 +1,4 @@
import { expect, test } from "bun:test";
import { expect, test } from "vitest";
import { dot, vec } from "./given.ts";
import { slide } from "./slide.ts";
@@ -1,4 +1,4 @@
import { expect, test } from "bun:test";
import { expect, test } from "vitest";
import { type AABB, vec } from "./given.ts";
import { moveAndSlide } from "./moveAndSlide.ts";
+1 -1
View File
@@ -1,4 +1,4 @@
import { expect, test } from "bun:test";
import { expect, test } from "vitest";
import { type AABB, aabbOverlap, vec } from "./given.ts";
import { penetrationVector, safeMoveAndSlide } from "./overlap.ts";
+1 -1
View File
@@ -1,4 +1,4 @@
import { expect, test } from "bun:test";
import { expect, test } from "vitest";
import { resolveOverlaps, safeMoveAndSlide } from "./crush.ts";
import { type AABB, aabbOverlap, vec } from "./given.ts";