Test262-Integrator
Integrates any project the test262-stream API with any ES host execution applying filters from a JS object.
Install
npm install --save-dev test262-integrator
Usage
const Integrator = require('test262-integrator');
Integrator({
testDir,
execute,
filters,
paths: ['test/built-ins/Array/from']
verbose:
}).then(results => {
}, err => {
});
function execute(test) {
}
** test262-stream
Filters
The filters object can include any properties known to Test262, as well as a special paths property whose value is an array of string paths relative to test262. All test file paths that match entries in paths will be skipped.
All tests that are matched by the filter object will have a property results whose value is { skip: true }.
Test262-Integrator recommends using a YAML file to store filters, as it's the most readable and maintainable format.
Examples
(See test/filters.yml for an extensive example)
YAML Filter File
features:
- tail-call-optimization
- generators
- default-parameters
JSON Filter File
{
"features": [
"tail-call-optimization",
"generators",
"default-parameters"
]
}
JavaScript Object Filter
const filters = {
features: [
'tail-call-optimization',
'generators',
'default-parameters'
]
};
More Extensive Example
const filters = {
features: [
'tail-call-optimization',
'SharedArrayBuffer',
],
esid: ['pending'],
es5id: ['15.1.2.2_A8', '15.1.2.3_A6'],
es6id: ['22.1.3.1_3'],
flags: ['module', 'async'],
paths: [
'harness',
'intl402',
'built-ins/Function/prototype/toString/',
'built-ins/SharedArrayBuffer/',
'built-ins/Atomics/',
'annexB/',
],
negative: {
type: ['SyntaxError'],
phase: [
'early',
'runtime',
],
},
};