forked from bytecodealliance/jco
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.js
42 lines (38 loc) · 1.47 KB
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
* Customize COMPONENT_FIXTURES env vars to use alternative test components
*
* COMPONENT_FIXTURES is a comma-separated list of component names ending in
* ".component.wasm".
*
* Each of these components will then be passed through code generation and linting.
*
* If a local runtime host.ts file is present for the component name in test/runtime/[name]/host.ts
* then the runtime test will be performed against that execution.
*
* When the runtime test is present, the flags in the runtime host.ts file will be used
* as the flags of the code generation step.
*/
import { env, platform } from 'node:process';
import { readdir } from 'node:fs/promises';
const componentFixtures = env.COMPONENT_FIXTURES
? env.COMPONENT_FIXTURES.split(',')
: (await readdir('test/fixtures/components')).filter(name => name !== 'dummy_reactor.component.wasm');
import { browserTest } from './browser.js';
import { codegenTest } from './codegen.js';
import { runtimeTest } from './runtime.js';
import { commandsTest } from './commands.js';
import { apiTest } from './api.js';
import { cliTest } from './cli.js';
import { preview2Test } from './preview2.js';
import { witTest } from './wit.js';
import { tsTest } from './typescript.js';
await codegenTest(componentFixtures);
tsTest();
await preview2Test();
await runtimeTest(componentFixtures);
await commandsTest();
await apiTest(componentFixtures);
await cliTest(componentFixtures);
await witTest();
if (platform !== 'win32')
await browserTest();