rename Env Variables

This commit is contained in:
Joshua 2024-01-31 09:22:07 +01:00
parent 5db74ebcb6
commit 9a41366c82
2 changed files with 4 additions and 4 deletions

View file

@ -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,
}, },
}, },
() => { () => {

View file

@ -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,