-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add parameter through --env CLI flag (#358)
- Loading branch information
Showing
8 changed files
with
129 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import test from 'ava' | ||
import { stripIndent } from 'common-tags' | ||
import debugApi from 'debug' | ||
import { effectiveConfig, extractCypressRun } from '../scripts/utils' | ||
|
||
const debug = debugApi('test') | ||
|
||
test('env parameter', async (t) => { | ||
const workflows = stripIndent` | ||
workflows: | ||
build: | ||
jobs: | ||
- cypress/run: | ||
env: foo=bar,baz=qux | ||
` | ||
|
||
const result = await effectiveConfig(workflows) | ||
if (debug.enabled) { | ||
debug('effective config') | ||
console.error(result) | ||
} | ||
const runTestsStep = extractCypressRun(result) | ||
debug('run test step: %o', runTestsStep) | ||
const runCommand = runTestsStep.command | ||
t.is(typeof runCommand, 'string') | ||
|
||
debug('run command: %s', runCommand) | ||
t.snapshot(runCommand, 'passing env values') | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Snapshot report for `manual-tests/env.test.ts` | ||
|
||
The actual snapshot is saved in `env.test.ts.snap`. | ||
|
||
Generated by [AVA](https://ava.li). | ||
|
||
## env parameter | ||
|
||
> passing env values | ||
'npx cypress run --env foo=bar,baz=qux' |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.