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: 01b5790f45e1623a9a422696998cb1fddf5b4483
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
  • 8 commits
  • 4 files changed
  • 3 contributors

Commits on Apr 6, 2020

  1. Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    e032edb View commit details
  2. 7.0.0

    juliangruber committed Apr 6, 2020

    Verified

    This commit was signed with the committer’s verified signature.
    zimme Simon Fridlund
    Copy the full SHA
    463bed9 View commit details
  3. Verified

    This commit was signed with the committer’s verified signature.
    zimme Simon Fridlund
    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

    Verified

    This commit was signed with the committer’s verified signature.
    zimme Simon Fridlund
    Copy the full SHA
    20125a6 View commit details
  2. 8.0.0

    juliangruber committed Jul 22, 2020

    Verified

    This commit was signed with the committer’s verified signature.
    zimme Simon Fridlund
    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 signed with the committer’s verified signature.
    zimme Simon Fridlund
    Copy the full SHA
    ccad1ea View commit details

Commits on Apr 12, 2021

  1. Verified

    This commit was signed with the committer’s verified signature.
    zimme Simon Fridlund
    Copy the full SHA
    57adc5f View commit details
  2. 9.0.0

    juliangruber committed Apr 12, 2021

    Verified

    This commit was signed with the committer’s verified signature.
    zimme Simon Fridlund
    Copy the full SHA
    ee4654e View commit details
Showing with 52 additions and 21 deletions.
  1. +2 −3 .travis.yml
  2. +44 −16 README.md
  3. +4 −0 bin/run.js
  4. +2 −2 package.json
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
sudo: false
language: node_js
node_js:
- 6
- node
- 12
- 14
addons:
apt:
packages:
60 changes: 44 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -122,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):
@@ -134,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).
@@ -160,9 +162,33 @@ $ browserify test.js | tape-run --render="tap-spec"
```
## Headless testing / Travis
## Headless testing
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:
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
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:
@@ -175,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
@@ -186,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
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": "6.0.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": "^6.0.0",
"browser-run": "^10.1.0",
"optimist": "~0.6.1",
"through": "~2.3.4",
"throughout": "0.0.0"