Skip to content

Commit e3d8ace

Browse files
Integrate component tests into the main test script
1 parent 919e8c7 commit e3d8ace

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

packages/npm-packages/ruby-head-wasm-wasi/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"README.md"
3030
],
3131
"scripts": {
32-
"test": "RUBY_NPM_PACKAGE_ROOT=../ruby-head-wasm-wasi npm -C ../ruby-wasm-wasi run test:run",
32+
"test": "RUBY_NPM_PACKAGE_ROOT=../ruby-head-wasm-wasi npm -C ../ruby-wasm-wasi run test:run:all",
3333
"build:deps": "cd ../ruby-wasm-wasi && npm run build",
3434
"build:static:files": "../ruby-wasm-wasi/tools/pack-static-files.sh ./dist",
3535
"build:static:compat": "../ruby-wasm-wasi/tools/pack-compat-shim.mjs --dist=./dist --pkg=ruby-head-wasm-wasi",

packages/npm-packages/ruby-wasm-wasi/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
],
4040
"license": "MIT",
4141
"scripts": {
42+
"test:run:all": "npm run test:run && ENABLE_COMPONENT_TESTS=1 npm run test:run",
4243
"test:run": "npm run test:unit && npm run test:vitest -- --run && npm run test:e2e",
4344
"test:vitest": "vitest ./test/",
4445
"test:unit": "./tools/run-test-unit.mjs",

packages/npm-packages/ruby-wasm-wasi/tools/run-test-unit.mjs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -212,11 +212,12 @@ const test = async (instantiate) => {
212212
};
213213

214214
const main = async () => {
215-
await test(instantiateNodeWasi);
216-
if (!process.env.RUBY_ROOT) {
217-
await test(instantiateBrowserWasi);
218-
if (process.env.ENABLE_COMPONENT_TESTS && process.env.ENABLE_COMPONENT_TESTS !== 'false') {
219-
await test(instantiateComponent);
215+
if (process.env.ENABLE_COMPONENT_TESTS && process.env.ENABLE_COMPONENT_TESTS !== 'false') {
216+
await test(instantiateComponent);
217+
} else {
218+
await test(instantiateNodeWasi);
219+
if (!process.env.RUBY_ROOT) {
220+
await test(instantiateBrowserWasi);
220221
}
221222
}
222223
};

0 commit comments

Comments
 (0)