mirror of
https://github.com/morluto/rea.git
synced 2026-11-23 06:55:55 +00:00
test(web): consolidate module syntax and capture identity fixtures (#13073)
This commit is contained in:
1 parent
f63915d6f2
commit
8322b55552
3 files changed
+140
-179
No files matched your search
@@ -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" },
|
||||
},
|
||||
],
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user