reword readme

This commit is contained in:
Joshua 2023-03-18 11:04:16 +01:00
parent 097014dccd
commit 771013c5a5

View file

@ -23,7 +23,7 @@ npm install --save-dev @datashard/snapshot
## Import ## Import
After installing, add the following to your `cypress/support/commands.js` file After installing, you need to add this snippet within your Cypress Support File (default: `cypress/support/e2e.{js,ts}`)
```js ```js
require("@datashard/snapshot").register(); require("@datashard/snapshot").register();
@ -31,7 +31,7 @@ require("@datashard/snapshot").register();
This registers a new command to create new snapshot or compare value to old snapshot This registers a new command to create new snapshot or compare value to old snapshot
and add the following to your `cypress.config.js` and add the following to your `cypress.config.{js,ts}`
```js ```js
e2e: { e2e: {
@ -61,7 +61,7 @@ describe("my tests", () => {
In the above case, you can find the stored snapshot in their own files, mentioned above them In the above case, you can find the stored snapshot in their own files, mentioned above them
```json ```jsonc
// cypress/snapshots/my-tests-works-foo.json // cypress/snapshots/my-tests-works-foo.json
{ "foo": 42 } { "foo": 42 }
// cypress/snapshots/my-tests-works-bar.json // cypress/snapshots/my-tests-works-bar.json
@ -81,8 +81,8 @@ You can control snapshot comparison and behavior through a few options.
```js ```js
cy.get(...).snapshot({ cy.get(...).snapshot({
snapshotName: 'Snapshot Name', // to use as a File Name snapshotName: 'Snapshot Name', // Overwrite the generated Snapshot name
snapshotPath: 'cypress/not_snapshots', // where to save the Snapshot snapshotPath: 'cypress/not_snapshots', // Overwrite where the Snapshot should be stored
json: false // convert DOM elements into JSON json: false // convert DOM elements into JSON
}) // when storing in the snapshot file }) // when storing in the snapshot file
@ -131,7 +131,7 @@ Authors:
<br> <br>
License: MIT - do anything with the code, but don't blame us if it does not work. License: MIT - do anything with the code, but don't blame us if it does not work.
Support: If you find any problems with this module [open an issue](https://github.com/cypress-io/snapshot/issues) on Github Support: If you find any problems with this module [open an issue](https://github.com/datashard/snapshot/issues) on Github
## MIT License ## MIT License