mirror of
https://github.com/datashard/snapshot.git
synced 2024-11-23 14:32:28 +00:00
provide better formatting for JSON in files
This commit is contained in:
parent
897ad51548
commit
8f6e32c072
1 changed files with 2 additions and 2 deletions
|
@ -16,7 +16,7 @@ const newStore = (name) => {
|
||||||
return initStore(name);
|
return initStore(name);
|
||||||
};
|
};
|
||||||
|
|
||||||
const store_snapshot = (store, props = { value, name, path, raiser }) => {
|
const store_snapshot = (store, props = { value, name, path, raiser}) => {
|
||||||
const expectedPath = path.join(
|
const expectedPath = path.join(
|
||||||
props.path ||
|
props.path ||
|
||||||
Cypress.config("snapshot").snapshotPath ||
|
Cypress.config("snapshot").snapshotPath ||
|
||||||
|
@ -27,7 +27,7 @@ const store_snapshot = (store, props = { value, name, path, raiser }) => {
|
||||||
if (exist && !Cypress.env().SNAPSHOT_UPDATE) {
|
if (exist && !Cypress.env().SNAPSHOT_UPDATE) {
|
||||||
props.raiser({ value: props.value, expected: JSON.parse(exist) });
|
props.raiser({ value: props.value, expected: JSON.parse(exist) });
|
||||||
} else {
|
} else {
|
||||||
cy.writeFile(expectedPath, JSON.stringify(props.value));
|
cy.writeFile(expectedPath, JSON.stringify(props.value, null, 2));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue