Skip to content

Commit d668226

Browse files
committed
Update README.md
1 parent 9e0dbde commit d668226

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

test/image/README.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ the above evaluates the output of `docker-machine env default`.
2626

2727
### Step 1: Run the testing container
2828

29-
Plotly.js uses `docker-compose` to ease the creation/stopping/deletion of testing docker container.
30-
29+
Plotly.js uses `docker-compose` to ease the creation/stopping/deletion of the testing docker container.
3130

3231
Inside your `plotly.js` directory, run
3332

@@ -39,8 +38,7 @@ In the `docker-compose.yml` file, `latest` is the latest Plotly Image-Server doc
3938
as listed on [hub.docker.com](https://hub.docker.com/r/plotly/imageserver/tags/) and
4039
`imagetest` is the name of the docker container. The `-d` flag tells docker to start the containers in the background and leave them running.
4140

42-
43-
### Step 2: Run the tests
41+
### Step 2: Run the image tests
4442

4543
Inside your `plotly.js` directory, run
4644

@@ -50,6 +48,16 @@ npm run test-image
5048

5149
if some tests fail, compare their outputs using `npm run start-image_viewer`.
5250

51+
### Step 2b: Make a new baseline image
52+
53+
Inside your `plotly.js` directory, run
54+
55+
```bash
56+
npm run baseline -- mock.json
57+
```
58+
59+
where `mock.json` is the name of a `{"data": [], "layout": {}}` json file found in [`test/image/mocks/`](https://github.com/plotly/plotly.js/tree/master/test/image/mocks). The `"data"` and `"layout"` field are passed to `Plotly.plot` to produce an image saved in [`test/image/baslines`](https://github.com/plotly/plotly.js/tree/master/test/image/baselines).
60+
5361
### Step 3: Stop your testing container
5462

5563
Once done testing, inside your `plotly.js` directory, run
@@ -126,7 +134,7 @@ Inside your `plotly.js` directory, run
126134
docker-compose rm -f
127135
```
128136

129-
#### Remove your docker machine
137+
##### Remove your docker machine
130138

131139
If named `default`:
132140

0 commit comments

Comments
 (0)