Skip to content

Commit

Permalink
Include more detailed Headless Testing section (#81)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
manzt authored Nov 3, 2020
1 parent 31de6f9 commit ccad1ea
Showing 1 changed file with 31 additions and 5 deletions.
36 changes: 31 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,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:
Expand All @@ -175,9 +199,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
Expand All @@ -186,7 +210,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
Expand Down

0 comments on commit ccad1ea

Please sign in to comment.