Wrap konfig load from scripts tests to avoid changing CWD (#4067)

* chore: add utility method to get konfig from scripts tests

Local scripts specs should be be caught by the changing current
directory when loading `konfig.coffee` (which loads `cwd.coffee`,
which changes the cwd to `packages/server`). This was throwing
snapshot tests into saving into a wrong folder until I have noticed
this and fixed in
[v8.0.3](https://github.com/bahmutov/snap-shot-core/releases/tag/v8.0.3)

* linting

* add more comments
This commit is contained in:
Gleb Bahmutov
2019-04-29 17:14:38 -04:00
committed by GitHub
parent 47e98fa1d0
commit 5015cbbe87
7 changed files with 76 additions and 4 deletions
+1 -1
View File
@@ -9,7 +9,7 @@ fs = require("fs")
os = require("os")
Promise = require("bluebird")
{configFromEnvOrJsonFile, filenameToShellVariable} = require('@cypress/env-or-json-file')
konfig = require("../../../packages/server/lib/konfig")
konfig = require('../../binary/get-config')()
formHashFromEnvironment = () ->
env = process.env