|
1 | | -import path from "node:path"; |
2 | | -import { loadRuntimeApiExportTypesViaJiti } from "openclaw/plugin-sdk/plugin-test-contracts"; |
| 1 | +import { runDirectImportSmoke } from "openclaw/plugin-sdk/plugin-test-contracts"; |
3 | 2 | import { describe, expect, it } from "vitest"; |
4 | 3 |
|
5 | 4 | describe("zalo runtime api", () => { |
6 | | - it("loads the narrow runtime api without reentering setup surfaces", () => { |
7 | | - const runtimeApiPath = path.join(process.cwd(), "extensions", "zalo", "runtime-api.ts"); |
| 5 | + it("loads the narrow runtime api without reentering setup surfaces", async () => { |
| 6 | + const stdout = await runDirectImportSmoke( |
| 7 | + `const runtime = await import("./extensions/zalo/runtime-api.ts"); |
| 8 | +process.stdout.write(JSON.stringify({ |
| 9 | + hasZaloPlugin: Object.hasOwn(runtime, "zaloPlugin"), |
| 10 | + hasZaloSetupWizard: Object.hasOwn(runtime, "zaloSetupWizard"), |
| 11 | + type: typeof runtime.setZaloRuntime, |
| 12 | +}));`, |
| 13 | + ); |
8 | 14 |
|
9 | | - expect( |
10 | | - loadRuntimeApiExportTypesViaJiti({ |
11 | | - modulePath: runtimeApiPath, |
12 | | - exportNames: ["setZaloRuntime"], |
13 | | - realPluginSdkSpecifiers: ["openclaw/plugin-sdk/runtime-store"], |
14 | | - }), |
15 | | - ).toEqual({ |
16 | | - setZaloRuntime: "function", |
17 | | - }); |
18 | | - }); |
| 15 | + expect(stdout).toBe('{"hasZaloPlugin":false,"hasZaloSetupWizard":false,"type":"function"}'); |
| 16 | + }, 45_000); |
19 | 17 | }); |
0 commit comments