What is Test262?
Test262 is the official conformance test suite for ECMAScript, maintained by TC39 (the committee that standardizes JavaScript). It contains thousands of tests covering all aspects of the ECMAScript specification, from basic syntax to complex edge cases in built-in objects and operations.Comprehensive coverage
Tests cover syntax, semantics, built-in objects, and edge cases across the entire ECMAScript specification.
Authoritative source
Maintained by TC39, the same committee that writes the ECMAScript specification.
Engine validation
All major JavaScript engines (V8, SpiderMonkey, JavaScriptCore) use Test262 to validate conformance.
Continuously updated
New tests are added as the specification evolves, ensuring implementations stay current.
Running Test262 tests
Arc provides multiple modes for running Test262 tests during development:Parser-only tests (fast)
Test only parsing conformance without executing code:Full execution tests (comprehensive)
Run the complete Test262 execution suite:- Built-in object behavior
- Type coercion rules
- Operator semantics
- Control flow
- Scope and closures
- Error handling
- Edge cases and corner cases
Saving test results
Write test results to a JSON file for analysis:Conformance status
Arc’s Test262 conformance is continuously tracked and visualized. Check the GitHub repository for the current conformance chart showing the pass rate across different categories of the ECMAScript specification.What the chart shows
The conformance chart displays:- Pass rate percentage - What portion of Test262 tests pass successfully
- Category breakdown - Conformance by spec area (built-ins, syntax, language features)
- Historical trends - How conformance has improved over time
- Known gaps - Areas where conformance is incomplete
Current conformance highlights
Strong conformance areas
Strong conformance areas
- Core syntax and operators
- Fundamental built-in objects (Object, Array, Function)
- Type coercion and comparison
- String and number operations
- Basic error handling
Partial conformance areas
Partial conformance areas
- Promises (core API implemented, static combinators missing)
- Regular expressions (basic matching, some advanced features incomplete)
- Generators (basic support, some edge cases)
- Symbol and well-known symbols
Known gaps
Known gaps
- Date and temporal operations (not yet implemented)
- Typed arrays and ArrayBuffer (not yet implemented)
- Proxy and Reflect (not yet implemented)
- Internationalization API (not yet implemented)
- Some advanced regular expression features
- WeakRef and FinalizationRegistry
Test262 categories
Test262 organizes tests into categories matching the ECMAScript specification structure:Language features
- Expressions - Operators, literals, function calls, property access
- Statements - Control flow, declarations, loops, exception handling
- Functions - Function declarations, expressions, arrows, parameters, scope
- Classes - Class declarations, inheritance, static/instance members
- Modules - Import/export syntax and semantics
Built-in objects
- Fundamental objects - Object, Function, Boolean, Symbol, Error types
- Numbers and dates - Number, Math, BigInt, Date
- Text processing - String, RegExp
- Indexed collections - Array, typed arrays
- Keyed collections - Map, Set, WeakMap, WeakSet
- Structured data - JSON, ArrayBuffer, SharedArrayBuffer
- Control abstraction - Promise, Generator, AsyncFunction
- Reflection - Reflect, Proxy
- Internationalization - Intl namespace
Global properties
- Value properties - undefined, NaN, Infinity, globalThis
- Function properties - eval, parseInt, parseFloat, isNaN, isFinite
- URI functions - encodeURI, decodeURI, encodeURIComponent, decodeURIComponent
Interpreting test failures
When Test262 tests fail, the failures fall into several categories:Unimplemented features
Unimplemented features
Features that are not yet implemented in Arc. For example, tests for
Date objects will fail because Arc doesn’t yet implement the Date API.Specification edge cases
Specification edge cases
Subtle edge cases in the specification that Arc doesn’t yet handle correctly. These are often complex interactions between features or corner cases in type coercion.
Intentional deviations
Intentional deviations
Cases where Arc intentionally deviates from the specification, usually for BEAM integration or runtime constraints.
Test harness limitations
Test harness limitations
Some tests may fail due to differences in the test environment rather than the implementation itself.
Contributing to conformance
Improving Test262 conformance is an ongoing effort. Here’s how to contribute:1. Identify failing tests
results.json to find specific failing tests.
2. Investigate the failure
Read the test source to understand what ECMAScript behavior it’s validating. Reference the specification sections mentioned in test metadata.3. Implement the missing behavior
Add or fix the implementation in the appropriate builtin module insrc/arc/vm/builtins/.
4. Verify the fix
Re-run tests to ensure the specific test now passes and no regressions were introduced:5. Update documentation
If implementing a new feature, update the API reference documentation to reflect the new functionality.Test262 test structure
Test262 tests are JavaScript files with special metadata:- description - Human-readable test purpose
- esid - ECMAScript specification section ID
- features - Language features required for the test
- flags - Special test behaviors (async, module, noStrict, etc.)
- negative - Expected error type for negative tests
Conformance goals
Arc aims for high conformance with modern ECMAScript while prioritizing:Resources
Test262 Repository
Official Test262 source code and documentation
ECMAScript Specification
The authoritative JavaScript language specification
Test262 Report
Compare conformance across JavaScript engines
TC39 Proposals
Upcoming JavaScript features and their status