test(web): consolidate module syntax and capture identity fixtures (#13073)

This commit is contained in:
morluto authored and GitHub committed 2026-11-21 06:02:44 -05:00
1 parent f63915d6f2
commit 8322b55552
3 files changed
+140 -179

No files matched your search

+3 -27
View File
@@ -2,10 +2,9 @@ import { describe, expect, it } from "vitest";
import { WebModuleTraceService } from "./WebModuleTraceService.js";
import { err, ok } from "../domain/result.js";
import { projectAnalysisError } from "../domain/analysisErrorProjection.js";
import {
webModuleTraceResultSchema,
type WebModuleResolution,
type WebModuleResolutionRequest,
import type {
WebModuleResolution,
WebModuleResolutionRequest,
} from "../domain/webModuleTrace.js";
import {
webModuleArtifactsFixture,
@@ -403,26 +402,3 @@ it("retains a completed engine-free trace when artifact loading finishes under c
},
});
});
it("resolves imports from relational JavaScript using the selected source grammar", async () => {
const artifacts = webModuleArtifactsFixture(
'const order = left < import("./dep.js") > (right);',
);
const result = await new WebModuleTraceService(
{ load: async () => ok(artifacts) },
webModuleResolverFixture,
).trace(args);
if (!result.ok) throw result.error;
expect(
webModuleTraceResultSchema.parse(result.value.normalized_result),
).toMatchObject({
parser: { state: "parsed", diagnostics: [] },
imports: [
{
kind: "dynamic-import",
specifier: "./dep.js",
resolution: { state: "resolved", url: "https://app.test/dep.js" },
},
],
});
});