forked from mbman/react
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscreener.config.js
More file actions
46 lines (38 loc) · 1.44 KB
/
Copy pathscreener.config.js
File metadata and controls
46 lines (38 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
const _ = require('lodash')
const glob = require('glob')
const path = require('path')
// https://github.com/screener-io/screener-runner
const screenerConfig = {
projectRepo: 'stardust-ui/react',
apiKey: process.env.SCREENER_API_KEY,
tunnel: {
host: 'localhost:8080',
gzip: true, // gzip compress all content being served from tunnel host
cache: true, // sets cache-control header for all content being served from tunnel host. Must be used with gzip option
},
diffOptions: {
structure: true,
layout: true,
style: true,
content: true,
minLayoutPosition: 1, // Optional threshold for Layout changes. Defaults to 4 pixels.
minLayoutDimension: 1, // Optional threshold for Layout changes. Defaults to 10 pixels.
minShiftGraphic: 1, // Optional threshold for pixel shifts in graphics.
compareSVGDOM: false, // Pass if SVG DOM is the same. Defaults to false.
},
// screenshot every example in maximized mode
states: glob
.sync('docs/src/examples/**/*.tsx', { ignore: ['**/index.tsx', '**/*.knobs.tsx'] })
.map(examplePath => {
const { name: nameWithoutExtension, base: nameWithExtension } = path.parse(examplePath)
return {
url: `http://localhost:8080/maximize/${_.kebabCase(nameWithoutExtension)}`,
name: nameWithExtension,
}
}),
}
if (process.env.CI) {
screenerConfig.baseBranch = 'master'
screenerConfig.failureExitCode = 0
}
module.exports = screenerConfig