Pass configuration via stdin
- Dominant language
- JavaScript
- Stars
- 7.2k
- Forks
- 621
- PR merge metrics
- No merged PRs in 30d
Description
For integration into ci chains it would be great to be able to pass the configuration via stdin to the backstop command which would allow to create the configuration on the fly in non js environments.
I already tried to use /dev/stdin which theoretically could work via `someCustomScript | backstop test --config=/dev/stdin` but ran into the problems below.
```
BackstopJS v5.0.7
Loading config: /dev/stdin
/dev/fd/0:2
"id": "Vendor_Site",
^
SyntaxError: Unexpected token ':'
at wrapSafe (internal/modules/cjs/loader.js:1070:16)
at Module._compile (internal/modules/cjs/loader.js:1120:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1176:10)
at Module.load (internal/modules/cjs/loader.js:1000:32)
at Function.Module._load (internal/modules/cjs/loader.js:899:14)
at Module.require (internal/modules/cjs/loader.js:1042:19)
at require (internal/modules/cjs/helpers.js:77:18)
at loadProjectConfig (/Users/MFI/.nvm/versions/node/v12.16.2/lib/node_modules/backstopjs/core/util/makeConfig.js:46:20)
at makeConfig (/Users/MFI/.nvm/versions/node/v12.16.2/lib/node_modules/backstopjs/core/util/makeConfig.js:62:38)
at module.exports (/Users/MFI/.nvm/versions/node/v12.16.2/lib/node_modules/backstopjs/core/runner.js:5:16)
```
The same command works when used with temporary files `someCustomScript > backstop.json && backstop test --config=backstop.json` but it would be really good to avoid the temporary file.
Contributor guide
Assessment
This issue has not been assessed yet.