Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: tape-testing/tape-run
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 500ce421358fde2c5e149e3402d2fdd83d044f00
Choose a base ref
...
head repository: tape-testing/tape-run
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: ee4654e596f5cbcbb8d77c9628da0ee6e1d39d4d
Choose a head ref

Commits on Mar 8, 2017

  1. Copy the full SHA
    ad1077b View commit details
  2. 3.0.0

    juliangruber committed Mar 8, 2017
    Copy the full SHA
    cad964a View commit details

Commits on Apr 12, 2017

  1. git ignore yarn.lock

    juliangruber committed Apr 12, 2017
    Copy the full SHA
    2b122ce View commit details

Commits on Aug 18, 2017

  1. docs: add webpack

    juliangruber authored Aug 18, 2017
    Copy the full SHA
    e6ea66c View commit details

Commits on Dec 4, 2017

  1. Copy the full SHA
    2eb9015 View commit details
  2. 3.0.1

    juliangruber committed Dec 4, 2017
    Copy the full SHA
    ed44bcd View commit details
  3. travis: drop 0.12

    juliangruber committed Dec 4, 2017
    Copy the full SHA
    3bdfd54 View commit details

Commits on Dec 5, 2017

  1. Add detail to webpack integration

    The description needs more detail to really explain anything. This file change clarifies steps needed for webpack integration, yet with minimal bloat to keep README.md nice to browse and read.
    
    Motivation: I believe there are people like me who use webpack instead of browserify and immediately want to integrate tape-run with webpack. With next to none details about the integration, it took me a long while to figure out everything needed. The first thing was that an additional `webpack.config.js` is needed to build the test suite. The second thing was that I can just `$ webpack --config ...` to run the tests, instead of something like `webpack | tape-run | tap-spec`. The third thing was that I do not need to add anything extra to the test code. These seem trivial afterwards but were hard to find out when everything was new.
    axelpale authored Dec 5, 2017
    Copy the full SHA
    4cb98b0 View commit details
  2. Merge pull request #70 from axelpale/patch-1

    Add detail to webpack integration
    juliangruber authored Dec 5, 2017
    Copy the full SHA
    8b01d6d View commit details

Commits on Jan 23, 2018

  1. Copy the full SHA
    4fdada2 View commit details
  2. 3.0.2

    juliangruber committed Jan 23, 2018
    Copy the full SHA
    193428b View commit details

Commits on Feb 9, 2018

  1. support

    juliangruber committed Feb 9, 2018
    Copy the full SHA
    257098f View commit details
  2. 3.0.3

    juliangruber committed Feb 9, 2018
    Copy the full SHA
    5defaec View commit details

Commits on Feb 10, 2018

  1. sponsors

    juliangruber committed Feb 10, 2018
    Copy the full SHA
    f7c7a68 View commit details
  2. 3.0.4

    juliangruber committed Feb 10, 2018
    Copy the full SHA
    f696cba View commit details

Commits on Mar 27, 2018

  1. remove package-lock

    juliangruber committed Mar 27, 2018
    Copy the full SHA
    16b5fe6 View commit details
  2. 4.0.0

    juliangruber committed Mar 27, 2018
    Copy the full SHA
    2186d4d View commit details

Commits on Dec 13, 2018

  1. update browser-run@5.0.1

    cezaraugusto committed Dec 13, 2018
    Copy the full SHA
    bcb8fad View commit details

Commits on Dec 14, 2018

  1. Merge pull request #73 from cezaraugusto/update-browser-run

    update browser-run@5.0.1
    juliangruber authored Dec 14, 2018
    Copy the full SHA
    9fa041c View commit details
  2. 5.0.0

    juliangruber committed Dec 14, 2018
    Copy the full SHA
    9fc2b4b View commit details

Commits on May 2, 2019

  1. Copy the full SHA
    544a86e View commit details
  2. 6.0.0

    juliangruber committed May 2, 2019
    Copy the full SHA
    0056a90 View commit details
  3. Copy the full SHA
    eb284e0 View commit details

Commits on Aug 20, 2019

  1. Add rollup documentation

    thanks @munrocket
    munrocket authored and juliangruber committed Aug 20, 2019
    Copy the full SHA
    e8c2b76 View commit details
  2. 6.0.1

    juliangruber committed Aug 20, 2019
    Copy the full SHA
    01b5790 View commit details

Commits on Apr 6, 2020

  1. Copy the full SHA
    e032edb View commit details
  2. 7.0.0

    juliangruber committed Apr 6, 2020
    Copy the full SHA
    463bed9 View commit details
  3. Copy the full SHA
    e93c616 View commit details

Commits on Jul 22, 2020

  1. Bump browser-run to latest, fixing electron security issue (#80)

    * Bump browser-run version to v8.0.0
    ... and removing sudo: false in travis-config + changing nodejs-version to test on from 12 and 13 to 12 and 14
    
    * Version bump
    
    * Changing to correct version number
    
    * Back to original version =)
    eklem authored Jul 22, 2020
    Copy the full SHA
    20125a6 View commit details
  2. 8.0.0

    juliangruber committed Jul 22, 2020
    Copy the full SHA
    31de6f9 View commit details

Commits on Nov 3, 2020

  1. Include more detailed Headless Testing section (#81)

    I tried to get a build working yesterday via Github Actions and kept hitting a wall. Found these suggestions on `browser-run` and copied here to make it easier to find.
    manzt authored Nov 3, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    ccad1ea View commit details

Commits on Apr 12, 2021

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    57adc5f View commit details
  2. 9.0.0

    juliangruber committed Apr 12, 2021

    Unverified

    This user has not yet uploaded their public signing key.
    Copy the full SHA
    ee4654e View commit details
Showing with 89 additions and 24 deletions.
  1. +1 −0 .gitignore
  2. +1 −0 .npmrc
  3. +2 −6 .travis.yml
  4. +79 −16 README.md
  5. +4 −0 bin/run.js
  6. +2 −2 package.json
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules
yarn.lock
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
8 changes: 2 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
sudo: false
language: node_js
node_js:
- "0.12"
- 4
- 5
- 6
- node
- 12
- 14
addons:
apt:
packages:
95 changes: 79 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -42,6 +42,35 @@ $ echo $?
0
```

## rollup

In simple cases you can run `rollup` and `tape-run` right from command line:
```bash
$ rollup test/test.js -f iife | tape-run
```
If you want to use a configuration file, here's an example for `rollup -c | tape-run`:
```js
import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import builtins from 'rollup-plugin-node-builtins';
import istanbul from 'rollup-plugin-istanbul';

export default {
input: 'test/test.js',
output: { format: 'iife', sourcemap: 'inline' },
plugins: [
resolve(),
commonjs(),
builtins(),
istanbul({ exclude: ['dist'] })
]
}
```

## With webpack

To use with [webpack](https://webpack.github.io/), set up a `webpack.test.config.js` to bundle your tape tests. Then, include [webpack-tape-run](https://github.com/syarul/webpack-tape-run) plugin in it. As a result, `$ webpack --config webpack.test.config.js` builds your tests with webpack, runs them in a headless browser, and outputs tap into console with correct exit code. Neat!

## API

You can use tape-run from JavaScript too:
@@ -93,9 +122,10 @@ on `http://localhost:<port>` and tests will be run there.
* `ie`
* `phantom`
* `safari`
* `keepOpen` (Boolean): Leave the browser open for debugging after running tests.
* `node` (Boolean): Enable nodejs integration for electron.
* `basedir` (String): Set this if you need to require node modules in `node` mode
* `keepOpen (Boolean)`: Leave the browser open for debugging after running tests.
* `node (Boolean)` Enable nodejs integration for electron.
* `sandbox (Boolean) [Default: true]`: Enable electron sandbox.
* `basedir` (String): Set this if you need to require node modules in `node` mode.
The **CLI** takes the same arguments, plus `--render` (see blow):
@@ -105,15 +135,16 @@ Pipe a browserify stream into this.
browserify [opts] [files] | tape-run [opts]
Options:
--wait Timeout for tap-finished
--port Wait to be opened by a browser on that port
--static Serve static files from this directory
--wait Timeout for tap-finished
--port Wait to be opened by a browser on that port
--static Serve static files from this directory
--browser Browser to use. Always available: electron. Available if installed: chrome, firefox, ie, phantom, safari [default: "electron"]
--render Command to pipe tap output to for custom rendering
--keep-open Leave the browser open for debugging after running tests
--node Enable nodejs integration for electron
--basedir Set this if you need to require node modules in node mode
--help Print usage instructions
--render Command to pipe tap output to for custom rendering
--keep-open Leave the browser open for debugging after running tests
--node Enable nodejs integration for electron
--sandbox Enable electron sandbox [default: true]
--basedir Set this if you need to require node modules in node mode
--help Print usage instructions
```
...or any of the [other options you can pass to browser-run](https://github.com/juliangruber/browser-run#runopts).
@@ -131,9 +162,33 @@ $ browserify test.js | tape-run --render="tap-spec"
```
## Headless testing / Travis
## Headless testing
In environments without a screen, you can use `Xvfb` to simulate one. We recommend using the default electron browser,
which however requires you to add additional parts to your headless configurations.
### GitHub Actions
To use tape-run with travis, we recommend using the default electron browser, which however requires you to add this part to your travis.yml:
This is a full example to run `npm test`. Refer to the last 2 lines in the YAML config:
```yml
on:
- pull_request
- push
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- run: npm install
- run: sudo apt-get install xvfb
- run: xvfb-run --auto-servernum npm test
```
### Travis
Add this to your travis.yml:
```yml
addons:
@@ -146,9 +201,9 @@ install:
- npm install
```
[Source](https://github.com/rhysd/Shiba/blob/055a11a0a2b4f727577fe61371a88d8db9277de5/.travis.yml).
[Full example](https://github.com/rhysd/Shiba/blob/055a11a0a2b4f727577fe61371a88d8db9277de5/.travis.yml).
For gnu/linux installations without a graphical environment:
### Any gnu/linux box
```bash
$ sudo apt-get install xvfb # or equivalent
@@ -157,7 +212,9 @@ $ Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
$ browser-run ...
```
There is also an example docker machine [here](https://github.com/fraserxu/docker-tape-run).
### Docker
There is also an example [Docker image](https://hub.docker.com/r/kipparker/docker-tape-run). [Source](https://github.com/fraserxu/docker-tape-run)
## Installation
@@ -168,6 +225,12 @@ $ npm install tape-run -g # for cli
$ npm install tape-run # for api
```
## Sponsors
This module is proudly supported by my [Sponsors](https://github.com/juliangruber/sponsors)!
Do you want to support modules like this to improve their quality, stability and weigh in on new features? Then please consider donating to my [Patreon](https://www.patreon.com/juliangruber). Not sure how much of my modules you're using? Try [feross/thanks](https://github.com/feross/thanks)!
## License
(MIT)
4 changes: 4 additions & 0 deletions bin/run.js
Original file line number Diff line number Diff line change
@@ -34,6 +34,10 @@ var argv = optimist
.alias('node-integration', 'node')
.alias('nodeIntegration', 'node')

.describe('sandbox', 'Enable electron sandbox')
.boolean('sandbox')
.default('sandbox', true)

.describe('basedir', 'Set this if you need to require node modules in node mode')

.describe('help', 'Print usage instructions')
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "tape-run",
"description": "Headless tape test runner",
"version": "2.4.1",
"version": "9.0.0",
"repository": {
"type": "git",
"url": "git://github.com/juliangruber/tape-run.git"
@@ -16,7 +16,7 @@
},
"dependencies": {
"@juliangruber/tap-finished": "0.0.2",
"browser-run": "^3.6.0",
"browser-run": "^10.1.0",
"optimist": "~0.6.1",
"through": "~2.3.4",
"throughout": "0.0.0"