test: align plugin jiti Windows expectations · openclaw/openclaw@1895353
steipete
·
2026-04-27
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | import fs from "node:fs"; |
2 | 2 | import path from "node:path"; |
| 3 | +import { pathToFileURL } from "node:url"; |
3 | 4 | import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; |
4 | 5 | import { shouldExpectNativeJitiForJavaScriptTestRuntime } from "../test-utils/jiti-runtime.js"; |
5 | 6 | import { cleanupTrackedTempDirs, makeTrackedTempDir } from "./test-helpers/fs-fixtures.js"; |
@@ -55,7 +56,9 @@ describe("doctor-contract-registry getJiti", () => {
|
55 | 56 | } |
56 | 57 | |
57 | 58 | expect(mocks.createJiti).toHaveBeenCalledTimes(1); |
58 | | -expect(mocks.createJiti.mock.calls[0]?.[0]).toBe(path.join(pluginRoot, "contract-api.js")); |
| 59 | +expect(mocks.createJiti.mock.calls[0]?.[0]).toBe( |
| 60 | +pathToFileURL(path.join(pluginRoot, "contract-api.js"), { windows: true }).href, |
| 61 | +); |
59 | 62 | expect(mocks.createJiti.mock.calls[0]?.[1]).toEqual( |
60 | 63 | expect.objectContaining({ |
61 | 64 | tryNative: expectedTryNative, |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | import fs from "node:fs"; |
2 | 2 | import path from "node:path"; |
| 3 | +import { pathToFileURL } from "node:url"; |
3 | 4 | import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; |
4 | 5 | import { shouldExpectNativeJitiForJavaScriptTestRuntime } from "../test-utils/jiti-runtime.js"; |
5 | 6 | import { cleanupTrackedTempDirs, makeTrackedTempDir } from "./test-helpers/fs-fixtures.js"; |
@@ -208,7 +209,9 @@ describe("setup-registry getJiti", () => {
|
208 | 209 | } |
209 | 210 | |
210 | 211 | expect(mocks.createJiti).toHaveBeenCalledTimes(1); |
211 | | -expect(mocks.createJiti.mock.calls[0]?.[0]).toBe(path.join(pluginRoot, "setup-api.js")); |
| 212 | +expect(mocks.createJiti.mock.calls[0]?.[0]).toBe( |
| 213 | +pathToFileURL(path.join(pluginRoot, "setup-api.js"), { windows: true }).href, |
| 214 | +); |
212 | 215 | expect(mocks.createJiti.mock.calls[0]?.[1]).toEqual( |
213 | 216 | expect.objectContaining({ |
214 | 217 | tryNative: expectedTryNative, |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。