Skip to content

Commit 0462214

Browse files
test(jco): add skipped tests to wast
1 parent c4c8fef commit 0462214

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

  • packages/jco/test/p3/ported/component-model

packages/jco/test/p3/ported/component-model/wast.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ import { suite, test, assert, beforeAll } from "vitest";
77
import { COMPONENT_MODEL_FIXTURES_WAST_DIR } from "../../../common.js";
88
import { fileExists } from "../../../helpers.js";
99

10+
// Relative paths to tests that should be skipped
11+
const TESTS_TO_SKIP = new Set([
12+
// NOTE: this test must be skipped until we update upstream libs
13+
"validation/implements.wast",
14+
]);
15+
1016
// These tests are ported from the component-model repo
1117
//
1218
// see: https://github.com/WebAssembly/component-model/tree/main/test
@@ -16,11 +22,14 @@ suite("component-model", async () => {
1622
const walker = await opendir(COMPONENT_MODEL_FIXTURES_WAST_DIR, { recursive: true });
1723

1824
for await (const dirent of walker) {
19-
if (!dirent.isFile()) {
25+
if (!dirent.isFile() || !dirent.name.endsWith(".wast")) {
2026
continue;
2127
}
28+
2229
const wastPath = join(dirent.parentPath, dirent.name);
2330
const wastRelPath = relative(COMPONENT_MODEL_FIXTURES_WAST_DIR, wastPath);
31+
if (TESTS_TO_SKIP.has(wastRelPath)) { continue; }
32+
2433
const wasmPath = join(COMPONENT_MODEL_FIXTURES_WAST_DIR, `${dirent.name}.wasm`);
2534
const scriptPath = join(COMPONENT_MODEL_FIXTURES_WAST_DIR, `${dirent.name}.js`);
2635
metadata.push({
@@ -45,7 +54,8 @@ suite("component-model", async () => {
4554
});
4655

4756
for (const { wastRelPath, wasmPath, scriptPath } of metadata) {
48-
test.concurrent(wastRelPath, async () => {
57+
const t = TESTS_TO_SKIP.has(wastRelPath) ? test.skip : test.concurrent;
58+
t(wastRelPath, async () => {
4959
assert(await fileExists(wasmPath), `missing generated wasm component @ [${wasmPath}]`);
5060
assert(await fileExists(scriptPath), `missing generated script @ [${scriptPath}]`);
5161
// TODO: convert WAST test to WAST + executable JS

0 commit comments

Comments
 (0)