-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deploy browserified test suite on every commit
This commit adds a script that bundles up the test suite, using browserify, into a form suitable for running against browsers. It will automatically be deployed on every commit to https://streams.spec.whatwg.org/tests/. This is, perhaps, the first step toward #216.
- Loading branch information
Showing
10 changed files
with
77 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
streams.spec.whatwg.org/ | ||
index.html | ||
/streams.spec.whatwg.org/ | ||
/index.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
node_modules/ | ||
bench/results/ | ||
npm-debug.log | ||
|
||
bench/results/ | ||
|
||
browser-tests/bundle.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Streams Standard Tests, In Your Browser | ||
|
||
This directory contains some preliminary work on creating a version of the [test suite](https://github.com/whatwg/streams/tree/master/reference-implementation/test) which can run in your browser, against any implementation that may be implemented there. | ||
|
||
To set these up, run the command `npm run build-browser-tests`. This will generate a `bundle.js` in this directory. At that point, `index.html` + `bundle.js` together will be enough to run the tests. (The other files in this directory are for the build process.) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
const browserify = require('browserify'); | ||
const es6ify = require('es6ify'); | ||
const glob = require('glob'); | ||
const path = require('path'); | ||
const fs = require('fs'); | ||
|
||
es6ify.traceurOverrides = { | ||
// Present in Chrome 41 | ||
blockBinding: 'parse', | ||
forOf: 'parse', | ||
generators: 'parse', | ||
numericLiterals: 'parse', | ||
symbols: false, | ||
templateLiterals: 'parse' | ||
|
||
// Probably Chrome 42 | ||
// classes: 'parse', | ||
// computedPropertyNames: 'parse', | ||
// propertyMethods: 'parse', | ||
// propertyNameShorthand: 'parse' | ||
}; | ||
|
||
|
||
const tests = glob.sync(path.resolve(__dirname, '../test/*.js')); | ||
const experimentalTests = glob.sync(path.resolve(__dirname, '../test/experimental/*.js')); | ||
|
||
const browserifyInstance = browserify({ debug: true }) | ||
.add(es6ify.runtime) | ||
.add(path.resolve(__dirname, 'setup.js')) | ||
.transform(es6ify); | ||
tests.concat(experimentalTests).forEach(t => browserifyInstance.add(t)); | ||
|
||
const dest = fs.createWriteStream(path.resolve(__dirname, 'bundle.js')); | ||
browserifyInstance.bundle().pipe(dest); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<title>Streams Standard Tests</title> | ||
|
||
<style> | ||
body { color: white; } | ||
</style> | ||
|
||
<body id="out"> | ||
<h1>Streams Standard Tests</h1> | ||
<p>This page runs the <a href="https://streams.spec.whatwg.org/">Streams Standard</a>'s <a href="https://github.com/whatwg/streams/tree/master/reference-implementation/test">test suite</a> against your current browser's implementation.</p> | ||
|
||
<script src="https://use.edgefonts.net/source-code-pro.js" async defer></script> | ||
<script src="bundle.js"></script> | ||
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
require('tape-catch').createStream().pipe(require('browserify-tape-spec')('out')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters