mirror of
https://github.com/datashard/snapshot.git
synced 2024-11-21 13:42:28 +00:00
rename Env Variables
This commit is contained in:
parent
5db74ebcb6
commit
9a41366c82
2 changed files with 4 additions and 4 deletions
|
@ -2,7 +2,7 @@
|
||||||
/* global cy */
|
/* global cy */
|
||||||
describe("datashard/snapshot", () => {
|
describe("datashard/snapshot", () => {
|
||||||
context("simple types"
|
context("simple types"
|
||||||
// , { env: { SNAPSHOT_UPDATE: true } }
|
// , { env: { updateSnapshots: true } }
|
||||||
, () => {
|
, () => {
|
||||||
it("works with objects", () => {
|
it("works with objects", () => {
|
||||||
cy.wrap({
|
cy.wrap({
|
||||||
|
@ -29,7 +29,7 @@ describe("datashard/snapshot", () => {
|
||||||
"works with arrays",
|
"works with arrays",
|
||||||
{
|
{
|
||||||
env: {
|
env: {
|
||||||
SNAPSHOT_UPDATE: true,
|
updateSnapshots: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
() => {
|
() => {
|
||||||
|
|
|
@ -12,7 +12,7 @@ const pickSerializer = (asJson, value) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const store_snapshot = (props = { value, name, raiser }) => {
|
const store_snapshot = (props = { value, name, raiser }) => {
|
||||||
if (Cypress.env().SNAPSHOT_UPDATE || Cypress.config('snapshot').SNAPSHOT_UPDATE) {
|
if (Cypress.env().updateSnapshots || Cypress.config('snapshot').updateSnapshots) {
|
||||||
cy.log(props.name)
|
cy.log(props.name)
|
||||||
console.log(props.name)
|
console.log(props.name)
|
||||||
cy.writeFile(`${props.name}.json`, JSON.stringify(props.value, null, 2))
|
cy.writeFile(`${props.name}.json`, JSON.stringify(props.value, null, 2))
|
||||||
|
@ -39,7 +39,7 @@ const set_snapshot = ({ snapshotName, serialized, value }) => {
|
||||||
|
|
||||||
const raiser = ({ value, expected }) => {
|
const raiser = ({ value, expected }) => {
|
||||||
const result = compareValues({ expected, value });
|
const result = compareValues({ expected, value });
|
||||||
if (!Cypress.env().SNAPSHOT_UPDATE && !result.success) {
|
if ((!Cypress.env().updateSnapshots || !Cypress.config('snapshot').updateSnapshots) && !result.success) {
|
||||||
devToolsLog = {
|
devToolsLog = {
|
||||||
...devToolsLog,
|
...devToolsLog,
|
||||||
message: result,
|
message: result,
|
||||||
|
|
Loading…
Reference in a new issue