Skip to content

Commit ccad1ea

Browse files
authored
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.
1 parent 31de6f9 commit ccad1ea

File tree

1 file changed

+31
-5
lines changed

1 file changed

+31
-5
lines changed

README.md

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,33 @@ $ browserify test.js | tape-run --render="tap-spec"
160160
161161
```
162162
163-
## Headless testing / Travis
163+
## Headless testing
164164
165-
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:
165+
In environments without a screen, you can use `Xvfb` to simulate one. We recommend using the default electron browser,
166+
which however requires you to add additional parts to your headless configurations.
167+
168+
### GitHub Actions
169+
170+
This is a full example to run `npm test`. Refer to the last 2 lines in the YAML config:
171+
172+
```yml
173+
on:
174+
- pull_request
175+
- push
176+
177+
jobs:
178+
test:
179+
runs-on: ubuntu-latest
180+
steps:
181+
- uses: actions/checkout@v1
182+
- run: npm install
183+
- run: sudo apt-get install xvfb
184+
- run: xvfb-run --auto-servernum npm test
185+
```
186+
187+
### Travis
188+
189+
Add this to your travis.yml:
166190
167191
```yml
168192
addons:
@@ -175,9 +199,9 @@ install:
175199
- npm install
176200
```
177201
178-
[Source](https://github.com/rhysd/Shiba/blob/055a11a0a2b4f727577fe61371a88d8db9277de5/.travis.yml).
202+
[Full example](https://github.com/rhysd/Shiba/blob/055a11a0a2b4f727577fe61371a88d8db9277de5/.travis.yml).
179203
180-
For gnu/linux installations without a graphical environment:
204+
### Any gnu/linux box
181205
182206
```bash
183207
$ sudo apt-get install xvfb # or equivalent
@@ -186,7 +210,9 @@ $ Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
186210
$ browser-run ...
187211
```
188212
189-
There is also an example docker machine [here](https://github.com/fraserxu/docker-tape-run).
213+
### Docker
214+
215+
There is also an example [Docker image](https://hub.docker.com/r/kipparker/docker-tape-run). [Source](https://github.com/fraserxu/docker-tape-run)
190216
191217
## Installation
192218

0 commit comments

Comments
 (0)