Skip to content

Commit 833ef1a

Browse files
committed
Removed old vite/vitest deps where possible
1 parent aa6fb10 commit 833ef1a

5 files changed

Lines changed: 339 additions & 87 deletions

File tree

packages/xl-ai/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@
109109
"@types/react": "^19.2.3",
110110
"@types/react-dom": "^19.2.3",
111111
"@vitejs/plugin-react": "^6.0.1",
112-
"@vitest/runner": "^4.1.2",
113112
"glob": "^10.5.0",
114113
"headers-polyfill": "^4.0.3",
115114
"msw": "^2.11.5",

packages/xl-ai/src/api/formats/tests/sharedTestCases.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import { Chat, UIMessage } from "@ai-sdk/react";
22
import { BlockNoteEditor } from "@blocknote/core";
3-
import { getCurrentTest, TestContext } from "@vitest/runner";
43
import path from "path";
54
import { TextSelection } from "prosemirror-state";
6-
import { describe, expect, it } from "vite-plus/test";
5+
import { describe, expect, it, TestContext, TestRunner } from "vite-plus/test";
76
import { AIExtension } from "../../../AIExtension.js";
87
import { sendMessageWithAIRequest } from "../../../index.js";
98
import { addOperationTestCases } from "../../../testUtil/cases/addOperationTestCases.js";
@@ -23,7 +22,7 @@ const BASE_FILE_PATH = path.resolve(__dirname, "__snapshots__");
2322
// @ts-expect-error - unused helper kept for debugging snapshots
2423
// eslint-disable-next-line @typescript-eslint/no-unused-vars
2524
async function matchFileSnapshot(data: any, postFix = "") {
26-
const t = getCurrentTest()!;
25+
const t = TestRunner.getCurrentTest()!;
2726
// this uses the same snapshot path, regardless of the model / streaming params
2827
await expect(data).toMatchFileSnapshot(
2928
path.resolve(

packages/xl-ai/src/api/formats/tests/snapshotPath.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { getCurrentTest } from "@vitest/runner";
21
import { getSortedEntries, toHashString } from "msw-snapshot";
32
import path from "node:path";
3+
import { TestRunner } from "vite-plus/test";
44

55
async function createRequestHash(req: Request): Promise<string> {
66
const url = new URL(req.url);
@@ -18,7 +18,7 @@ export function createSnapshotPathFn(_basePath: string) {
1818
const fetchCountMap: Record<string, number> = {};
1919

2020
return async (info: { request: Request }): Promise<string> => {
21-
const t = getCurrentTest()!;
21+
const t = TestRunner.getCurrentTest()!;
2222
const mswPath = path.join(
2323
t.suite!.name,
2424
"__msw_snapshots__",

0 commit comments

Comments
 (0)