Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow name to be provided to toMatchSnapshot #92

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

cmcculloh-kr
Copy link
Contributor

Allows user to provide custom name for their screenshots and snapshots:

			.screenshot({ path: settings.imageSnapshotPath + 'admin.0000.png'})
			.toMatchSnapshot({ name: 'admin.0000' })

Allows user to provide custom name for their screenshots and snapshots:
```
			.screenshot({ path: settings.imageSnapshotPath + 'admin.0000.png'})
			.toMatchSnapshot({ name: 'admin.0000' })
```
@@ -200,24 +200,36 @@ export default class Target {
}
}

async toMatchSnapshot(image, callback) {
async toMatchSnapshot(image, callback, settings) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we could move all these sanitizations to a separate function like sanitiseToMatchSnapshotArg()?!

@NimaSoroush
Copy link
Owner

@CormacMcCarthy , Thanks for the PR. Can you add an example to API.md page and an integration test. It will help other people to understand the usecase better

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants