This is a bit of a hacky harness to run Web Platform Tests against Javy.
Web Platform Tests are included as a submodule.
$ git submodule init
$ git submodule update
$ npm i
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.
$ npm test
Test suites can be added in test_spec.js
. Individual tests can be ignored by including their name in the test's ignore list.
- Adding tests to the ignored list is acceptable if there is no intent to support the feature the test is testing.
- We highly recommend running the WPT suite with the
experimental_event_loop
Cargo feature enabled on thejavy-core
crate so tests relying on the event loop are able to pass. - 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.
- You may need to copy the test into the
custom_tests
directory and make small changes, then have thetest_spec.js
file 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