test(script-runners): fix on Windows

This commit is contained in:
Zoltan Kochan
2020-12-16 03:15:24 +02:00
parent 5b0b6e3dc4
commit efd81fb105
3 changed files with 5 additions and 1 deletions

View File

@@ -41,6 +41,7 @@
"@types/ramda": "^0.27.32",
"@zkochan/rimraf": "^1.0.0",
"execa": "^4.1.0",
"is-windows": "^1.0.2",
"mz": "^2.7.0",
"write-yaml-file": "^4.1.1"
},

View File

@@ -10,6 +10,7 @@ import prepare, { preparePackages } from '@pnpm/prepare'
import { REGISTRY_MOCK_PORT } from '@pnpm/registry-mock'
import { DEFAULT_OPTS, REGISTRY } from './utils'
import execa = require('execa')
import isWindows = require('is-windows')
import fs = require('mz/fs')
import path = require('path')
import writeYamlFile = require('write-yaml-file')
@@ -389,7 +390,7 @@ test('pnpm run with custom shell', async () => {
dir: process.cwd(),
extraBinPaths: [],
rawConfig: {},
scriptShell: path.resolve('node_modules/.bin/shell-mock'),
scriptShell: path.resolve(`node_modules/.bin/shell-mock${isWindows() ? '.cmd' : ''}`),
}, ['build'])
expect((await import(path.resolve('shell-input.json'))).default).toStrictEqual(['-c', 'foo bar'])

2
pnpm-lock.yaml generated
View File

@@ -2013,6 +2013,7 @@ importers:
'@types/ramda': 0.27.32
'@zkochan/rimraf': 1.0.0
execa: 4.1.0
is-windows: 1.0.2
mz: 2.7.0
write-yaml-file: 4.1.1
specifiers:
@@ -2032,6 +2033,7 @@ importers:
'@types/ramda': ^0.27.32
'@zkochan/rimraf': ^1.0.0
execa: ^4.1.0
is-windows: ^1.0.2
mz: ^2.7.0
p-limit: ^3.1.0
path-exists: ^4.0.0