web-streams

0.8.0 • Public • Published

Reference Implementation and Tests

This folder contains a reference implementation of the streams standard, inside lib/. It also contains a test suite inside test/.

Reference Implementation

The reference implementation is meant to be a fairly close transcription of the spec into JavaScript. It is written in modern JavaScript and primarily tested in Node.js; at least version 6.0.0 is required.

Tests

Test coverage is not complete, but we do aim for it to be. Adding tests would be a great way to contribute to this project.

You can check the test coverage at any time by running npm run coverage in this folder.

Original Tests

The original tests are written using the tape framework.

  • To run them, type npm test in this folder.
  • To run a specific test file, type e.g. node test-runner test/readable-stream.js.
  • To run a specific test, change the source file's test(...) call to test.only(...), then run npm test.

Web Platform Tests

After we started implementing this in browsers, we realized that we should probably have written the tests in standard web platform tests format. Fixing this has been an ongoing effort, with major help from WebKit contributors, who ported the initial set of tests from our original format.

The web platform tests for streams are found in the streams directory of the web platform tests repository, and maintained via pull requests to that repository.

For local development while working on the spec, you can run

bash ./update-web-platform-tests.sh

to clone the web platform tests repository locally, and then use

npm run wpt

to run the streams web platform tests against the reference implementation, inside a Node.js emulated-DOM environment. If you make changes to the tests locally, for example while making a spec change, please send them as a pull request to the web platform tests repository.

Readme

Keywords

none

Package Sidebar

Install

npm i web-streams

Weekly Downloads

8

Version

0.8.0

License

(CC0-1.0 OR MIT)

Last publish

Collaborators

  • daluege