Skip to content

Commit

Permalink
test(kentcdodds#99): simplify base test case
Browse files Browse the repository at this point in the history
So it does not rely on quotation logic to pass.
  • Loading branch information
hgwood committed Apr 5, 2017
1 parent 14610d0 commit 3fab193
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,15 +136,15 @@ function testEnvSetting(expected, ...envSettings) {
// set APPDATA and test it
process.env.APPDATA = '0'
}
const ret = crossEnv([...envSettings, 'echo', 'hello world'])
const ret = crossEnv([...envSettings, 'echo', 'hello-world'])
const env = {}
if (process.env.APPDATA) {
env.APPDATA = process.env.APPDATA
}
Object.assign(env, expected)
expect(ret, 'returns what spawn returns').toBe(crossSpawnMock.__mock.spawned)
expect(crossSpawnMock.spawn).toHaveBeenCalledTimes(1)
expect(crossSpawnMock.spawn).toHaveBeenCalledWith('echo', ['"hello world"'], {
expect(crossSpawnMock.spawn).toHaveBeenCalledWith('echo', ['hello-world'], {
stdio: 'inherit',
shell: true,
env: Object.assign({}, process.env, env),
Expand Down

0 comments on commit 3fab193

Please sign in to comment.