Skip to content

Commit 2b16f1c

Browse files
fix: build symbolicate wasm for coverage
1 parent 9ab85f4 commit 2b16f1c

2 files changed

Lines changed: 19 additions & 1 deletion

File tree

.github/scripts/workflow-policy.test.mjs

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { describe, it } from "node:test";
66
const ROOT_URL = new URL("../../", import.meta.url);
77
const WORKFLOWS_URL = new URL("workflows/", new URL("../", import.meta.url));
88
const CI_WORKFLOW_URL = new URL("ci.yml", WORKFLOWS_URL);
9+
const COVERAGE_WORKFLOW_URL = new URL("coverage.yml", WORKFLOWS_URL);
910

1011
const trackedPackageLocks = async () => {
1112
const tracked = execFileSync("git", ["ls-files", "--", ":(glob)**/package-lock.json"], {
@@ -85,6 +86,22 @@ describe("WASM package coverage", () => {
8586
const test = "corepack pnpm run test:js";
8687

8788
assert.ok(job.includes(build), "missing symbolicate WASM build");
88-
assert.ok(job.indexOf(build) < job.indexOf(test), "symbolicate WASM must build before JS tests");
89+
assert.ok(
90+
job.indexOf(build) < job.indexOf(test),
91+
"symbolicate WASM must build before JS tests",
92+
);
93+
});
94+
95+
it("builds symbolicate WASM targets before JavaScript coverage", async () => {
96+
const workflow = await readFile(COVERAGE_WORKFLOW_URL, "utf8");
97+
const job = workflowJob(workflow, "coverage");
98+
const build = "corepack pnpm --filter @srcmap/symbolicate-wasm build:all";
99+
const coverage = "corepack pnpm run coverage:js";
100+
101+
assert.ok(job.includes(build), "missing symbolicate WASM coverage build");
102+
assert.ok(
103+
job.indexOf(build) < job.indexOf(coverage),
104+
"symbolicate WASM must build before JS coverage",
105+
);
89106
});
90107
});

.github/workflows/coverage.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ jobs:
7777
corepack pnpm --filter @srcmap/sourcemap-wasm build
7878
corepack pnpm --filter @srcmap/generator-wasm build
7979
corepack pnpm --filter @srcmap/remapping-wasm build
80+
corepack pnpm --filter @srcmap/symbolicate-wasm build:all
8081
8182
# JS coverage (lcov)
8283
- name: JS coverage

0 commit comments

Comments
 (0)