Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/faebeee/refactor-insurance
https://github.com/faebeee/refactor-insurance
Last synced: about 5 hours ago
JSON representation
- Host: GitHub
- URL: https://github.com/faebeee/refactor-insurance
- Owner: faebeee
- Created: 2020-10-17T07:37:02.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2020-11-22T16:32:08.000Z (almost 4 years ago)
- Last Synced: 2024-04-26T21:47:28.443Z (7 months ago)
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/refactor-insurance
- Size: 384 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# refactor-insurance
Often during refactoring, stuff breaks and is undetected until production. With `refactor-insurance` you
can configure some urls which will be screenshotted. After you've completed your refactoring, rerun the tool to compare
the screenshots you've taken before your refactor and compare them with a newly created screenshot. If the images do not
match, you can investigate further.## Install
npm i -g refactor-insurance
## Usage### `generate`
Generate screenshots configured in the config filerefactor generate ./localhost.js
### `compare`Compare generated screenshots with new ones
refactor compare ./localhost.js
## ConfigWithin the `auth` object, you can describe how the login should happen. This is useful for sites, which require
login or have a lockdown page. The `auth` object is optional.In the `urls` you can pass a list of urls which should be compared
__localhost.js__
```javascript
export default [{
id: "test",
url: "http://localhost:3000",
viewport: [1080, 1024],
pages: [
{
path: '/de',
id: 'landingpage',
/**
* @param {import('puppeteer').Page} page
* @returns {Promise}
*/
setup: async (page) => {
}
},
{
path: '/de/map-module/participant',
id: 'participant-document-groups',
/**
* @param {import('puppeteer').Page} page
* @returns {Promise}
*/
setup: async (page) => {
}
},
{
path: '/de/map-module/participant',
id: 'participang-map-module',
/**
* @param {import('puppeteer').Page} page
* @returns {Promise}
*/
setup: async (page) => {
}
}
]
}]
```