From 17845a481fa67eb632181b7e68cf4ec874ed5958 Mon Sep 17 00:00:00 2001 From: Strahinja Mitrovic Date: Sun, 26 Aug 2018 01:43:16 +0200 Subject: [PATCH] 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 --- packages/pnpm/test/run.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packages/pnpm/test/run.ts b/packages/pnpm/test/run.ts index ffd978f14a..5acfbfd02d 100644 --- a/packages/pnpm/test/run.ts +++ b/packages/pnpm/test/run.ts @@ -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') +})