npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

test262-integrator

v1.2.0

Published

Soothes attaching Test262 on different projects

Downloads

69

Readme

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, // String: the path where Test262 is located.
  execute, // (Async/Sync) Function: this function is called for 
           // every non-skipped test file, the return should be a 
           // result object.
  filters, // (Optional) Object: a list of filters, see 'test/filters.yml' 
           //  for an example.
  paths: ['test/built-ins/Array/from'] // (Optional) Array of Strings: 
                                       // specifies exclusive paths to
                                       // run the test.
  verbose: // (Optional) Boolean: toggles a verbose mode for files 
           // execution (experimental).
}).then(results => {
  // `results` is an Array of objects. Each object contains all 
  // relevant information for a given test produced by the test stream, with
  // an additional `result` property which contains the results of
  // the execution. If a test was skipped via filtering parameters, the
  // value of result property is { skip: true }.

  // Anything returned from the `execute` method will be stored in the 
  // result property.
}, err => {
  // Any execution error will be available here
});

// The execute function signature:
function execute(test) {
  // `test` has the same properties used in test262-stream*

  // This function can return a promise for async operations.
}

** 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 = {
  // Filters by metadata:
  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'],

  // Filters by path location:
  paths: [
    // filters will apply to any match, as long as the path contains the string from any index.
    // In this example, any file path containing `harness` will be skipped.
    'harness',
    'intl402',
    'built-ins/Function/prototype/toString/',
    'built-ins/SharedArrayBuffer/',
    'built-ins/Atomics/',
    'annexB/',
  ],

  // Filter negative tests by any matching phases and type
  negative: {
    type: ['SyntaxError'],
    phase: [
      'early',
      'runtime',
    ],
  },
};