Before attempting to run WPT tests for the first time, please run the WPT setup. You must also run this command every time the ./test_util/wpt submodule is updated:

    To run all available web platform tests, run the following command:

    1. # You can also filter which test files to run by specifying filters:
    2. ./tools/wpt.ts run -- streams/piping/general hr-time

    The test runner will run each web platform test and record its status (failed or ok). It will then compare this output to the expected output of each test as specified in the ./tools/wpt/expectation.json file. This file is a nested JSON structure that mirrors the ./test_utils/wpt directory. It describes for each test file, if it should pass as a whole (all tests pass, true), if it should fail as a whole (test runner encounters an exception outside of a test or all tests fail, false), or which tests it expects to fail (a string array of test case names).

    1. ./tools/wpt.ts update -- hr-time

    After running this command the expectation.json file will match the current output of all the tests that were run. This means that running wpt.ts run right after a wpt.ts update should always pass.

    setup

    Validate that your environment is configured correctly, or help you configure it.

    This will check that the python3 (or python.exe on Windows) is actually Python 3.

    You can specify the following flags to customize behaviour:

    run

    You can specify the following flags to customize behaviour:

    1. --release
    2. Use the ./target/release/deno binary instead of ./target/debug/deno
    3. --quiet
    4. --json=<file>
    5. Output the test results as JSON to the file specified.

    You can also specify exactly which tests to run by specifying one of more filters after a --:

    1. ./tools/wpt.ts run -- hr-time streams/piping/general

    Update the expectation.json to match the current reality.

    You can specify the following flags to customize behaviour:

    1. ./tools/wpt.ts update -- hr-time streams/piping/general

    Upgrading the wpt submodule:

    1. cd test_util/wpt/
    2. # Rebase to retain our modifications
    3. git rebase origin/master

    All contributors will need to rerun ./tools/wpt.ts setup after this.