Web Platform Tests
May 21, 2026 ยท View on GitHub
This is a bit of a hacky harness to run Web Platform Tests against Javy.
Setup
Web Platform Tests are included as a submodule.
$ git submodule init
$ git submodule update
$ pnpm install
Testing
This command uses rollup with a custom plugin to bundle all selected tests into one bundle. It then uses the local build of javy to turn that bundle into a WebAssembly module, and finally runs that WebAssembly module using wasmtime.
Make sure you have wasmtime installed and built javy locally.
If wasmtime generates no output, all tests have been passed. Otherwise, it's a failure.
$ pnpm test
Test selection
Test suites can be added in test_spec.js. Individual tests can be ignored by including their name in the test's ignore list.
Tips for getting tests to pass
- Adding tests to the ignored list is acceptable if there is no intent to support the feature the test is testing.
- Strongly consider adding tests in Rust for APIs you're adding to get faster feedback on failures the WPT suite catches while working on a fix.
If you need to change upstream tests
- You may need to copy the test into the
custom_testsdirectory and make small changes, then have thetest_spec.jsfile run the copied test file instead of the upstream one.- An example of this is commenting out small parts of test cases that are testing functionality that is intentionally not supported (for example, UTF-16 support for
TextDecoder).
- An example of this is commenting out small parts of test cases that are testing functionality that is intentionally not supported (for example, UTF-16 support for