Skip to content

Commit 5fd6d86

Browse files
authored
feat: screenshot testing (material-components#10)
Add screenshot testing with support for local and CI testing. Add Travis CI with support for unit tests, linting, and screenshot testing.
1 parent 0c6a581 commit 5fd6d86

16 files changed

+1122
-80
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@ coverage
33
node_modules
44
.DS_Store
55
*.iml
6+
*.snapshot.png
7+
*.diff.png
8+
key.json

.travis.yml

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,28 @@
11
language: node_js
2-
node_js: 8
3-
dist: trusty
4-
sudo: required
52
git:
63
depth: false
7-
branches:
8-
only:
9-
- experimental/travis
10-
addons:
11-
chrome: stable
12-
install:
13-
- npm i
14-
script:
15-
- npm run test:ci
4+
5+
dist: trusty
6+
sudo: required
7+
8+
matrix:
9+
include:
10+
- node_js: 8
11+
env: TEST_SUITE=unit
12+
install: npm i
13+
script: npm run test:unit-ci
14+
15+
- node_js: 8
16+
env: TEST_SUITE=lint
17+
install: npm i
18+
script: npm run lint
19+
20+
- node_js: 8
21+
env: TEST_SUITE=screenshots
22+
install: npm i
23+
script:
24+
- ./test/screenshot/start.sh
25+
- sleep 10s
26+
- npm run test:image-diff
27+
after_script:
28+
- COMMIT_HASH=$(git rev-parse --short HEAD) npm run upload:screenshots

0 commit comments

Comments
 (0)