Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed May 17, 2019
1 parent ce69d61 commit c45aa2b
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions test/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,18 @@ const snapshotTest = async function({ t, methodProps, data }) {
const fireTask = async function({
method,
task = 'main',
command,
opts,
buffer,
read,
execaOpts: { env, ...execaOpts } = {},
...input
}) {
const inputA = JSON.stringify(input)
const input = JSON.stringify({ command, opts, buffer, read })
const execaEnv = { INPUT: input, CI: '', ...env }
const execaOptsA = { reject: false, env: execaEnv, ...execaOpts }
const { exitCode, stdout, stderr } = await execa(
`gulp --gulpfile ${GULPFILES_DIR}/${method}.js ${task}`,
{ reject: false, env: { INPUT: inputA, CI: '', ...env }, ...execaOpts },
execaOptsA,
)
const stdoutA = normalizeMessage(stdout)
const stderrA = normalizeMessage(stderr)
Expand Down

0 comments on commit c45aa2b

Please sign in to comment.