[Base-66] Visual regression#6
Conversation
9c4b963 to
1877b7e
Compare
|
This is just a test comment. You can ignore it. @infrastructure_team will delete it soon. |
|
|
||
| ## Installation instructions | ||
| TODO | ||
| `yarn install` or `npm install` |
There was a problem hiding this comment.
shouldn't we stick to one?
| module.exports = { | ||
| sourceFiles: path.resolve(__dirname, '../components'), | ||
| ignoredFiles: ['components/**/test.js', 'components/**/test.jsx'], | ||
| ignoredFiles: ['components/**/test.js', 'components/**/test.jsx', 'components/**/visual.test.jsx', 'components/**/visual.test.js'], |
There was a problem hiding this comment.
wouldn't components/**/test.js?(x) work? same for visualt.test.js?(x)
There was a problem hiding this comment.
Thanks, it works, slightly different though: components/**/test.jsx?
There was a problem hiding this comment.
as with webpack, right ;)
There was a problem hiding this comment.
We don't have webpack, if I'm not mistaken, this is just node glob syntax. Good catch
There was a problem hiding this comment.
Hmm, I see that for jest configuration and ignored patterns, same syntax didn't work 🤔 so there is some difference between the two
| "rimraf": "^2.6.2", | ||
| "yargs": "^12.0.5" | ||
| "yargs": "^12.0.5", | ||
| "puppeteer": "^1.11.0", |
There was a problem hiding this comment.
what do you think about adding a separate package.json for tests? e.g. to skip installing puppeteer - pretty heavy dep
There was a problem hiding this comment.
What could be the use case that you would want to install everything except the puppeteer? I imagine if you are touching something in a project, you would be running visual tests as well to verify that you haven't broke anything
ef32b6a to
66b28ad
Compare
66b28ad to
d4bceab
Compare
Added setup, helpers and instructions for running visual regression tests on our components. For now, it's tightly coupled with react storybook, in the future we should make these tests automatic from our documentation or something like that.
I change initial approach a little, decided to use pure puppeteer (with jest preset) with snapshot plugin - works like a charm now and specs are much faster.