Skip to content

Commit cf0b6f6

Browse files
test: spawn shell.
1 parent 02088f5 commit cf0b6f6

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

src/duel.js

+7-4
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,12 @@ const duel = async args => {
146146
dualConfigPath = join(subDir, `tsconfig.${hex}.json`)
147147
await mkdir(subDir)
148148
await Promise.all(
149-
compileFiles.map(async file =>
150-
{
151-
const dest = join(subDir, relative(projectDir, file).replace(/^(\.\.\/)*/, ''))
149+
compileFiles.map(
150+
async file => {
151+
const dest = join(
152+
subDir,
153+
relative(projectDir, file).replace(/^(\.\.\/)*/, ''),
154+
)
152155
const { dir } = parse(dest)
153156

154157
try {
@@ -160,7 +163,7 @@ const duel = async args => {
160163
}
161164

162165
return copyFile(file, dest)
163-
}
166+
},
164167
//cp(file, join(subDir, relative(projectDir, file).replace(/^(\.\.\/)*/, ''))),
165168
),
166169
)

test/integration.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { dirname, resolve, join } from 'node:path'
55
import { rm, readFile, rename } from 'node:fs/promises'
66
import { existsSync } from 'node:fs'
77
import { spawnSync, execSync } from 'node:child_process'
8+
import { platform } from 'node:process'
89

910
import { duel } from '../src/duel.js'
1011

@@ -119,7 +120,7 @@ describe('duel', () => {
119120
const { status: statusEsm } = spawnSync(
120121
'node',
121122
['test/__fixtures__/esmProject/dist/index.js'],
122-
{ stdio: 'inherit' },
123+
{ stdio: 'inherit', shell: platform === 'win32' },
123124
)
124125
assert.equal(statusEsm, 0)
125126
const { status: statusCjs } = spawnSync(

0 commit comments

Comments
 (0)