test: issue with passing properly args to the comannd

pnpm does not properly pass arguments to command that is specfied
in the build script as npm does, with this commit pnpm passes
arguments exaclty like npm.

close #1124
This commit is contained in:
Strahinja Mitrovic
2018-08-26 01:43:16 +02:00
committed by Zoltan Kochan
parent 5fa20dd6ac
commit 17845a481f

View File

@@ -18,3 +18,15 @@ test('pnpm run: returns correct exit code', async (t: tape.Test) => {
t.equal(execPnpmSync('run', 'exit0').status, 0)
t.equal(execPnpmSync('run', 'exit1').status, 1)
})
test('pass the args to the command that is specfied in the build script', async t => {
prepare(t, {
scripts: {
test: 'ts-node test'
},
})
const result = execPnpmSync('run', 'test', '--', '--flag=true')
t.ok((result.stdout as Buffer).toString('utf8').match(/ts-node test "--flag=true"/), 'command was successful')
})