The `test262-parser-runner` is a utility designed to execute the official ECMAScript Test Suite (Test262) against any given JavaScript parser. Currently at version 0.5.0, it targets early-stage development and parser validation. While it doesn't specify a fixed release cadence, its versioning suggests ongoing development with potentially frequent updates. A key differentiator is its robust mechanism for managing test outcomes: it supports a `skip` filter function to completely ignore tests (e.g., for unimplemented features) and a `whitelist` array for tests expected to fail temporarily but eventually pass. This allows parser developers to precisely control which tests contribute to their pass/fail metrics. The project distinguishes itself by building upon a previously MIT-licensed test runner while distributing its own code under the GNU Affero General Public License v3.0, a significant detail for downstream users.
npm install test262-parser-runnerVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to run the Test262 suite against the Acorn parser, configuring custom skip and whitelist rules, and specifying the Test262 repository path.
Review the AGPLv3.0 license terms carefully to understand your obligations before integrating into your project, especially if distributing commercially or as part of a proprietary system.
Pin exact versions (e.g., `"test262-parser-runner": "0.5.0"`) or use a tilde range (`~0.5.0`) to avoid unexpected updates. Regularly check the project's changelog for breaking changes.
Always provide an explicit `testsDirectory` option pointing to a fresh, cloned copy of the official `tc39/test262` GitHub repository to ensure you are testing against the most current suite.
Ensure the path provided to `testsDirectory` is correct and accessible. Clone the `tc39/test262` repository locally and point the option to its root directory.
Verify that your parser (e.g., `acorn.parse`) is correctly imported and that the wrapper function passed to `run` correctly calls it with `content` and `sourceType`.