Skip to content

Commit

Permalink
test: spawn shell.
Browse files Browse the repository at this point in the history
  • Loading branch information
knightedcodemonkey committed Sep 30, 2024
1 parent 02088f5 commit cf0b6f6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
11 changes: 7 additions & 4 deletions src/duel.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,12 @@ const duel = async args => {
dualConfigPath = join(subDir, `tsconfig.${hex}.json`)
await mkdir(subDir)
await Promise.all(
compileFiles.map(async file =>
{
const dest = join(subDir, relative(projectDir, file).replace(/^(\.\.\/)*/, ''))
compileFiles.map(
async file => {
const dest = join(
subDir,
relative(projectDir, file).replace(/^(\.\.\/)*/, ''),
)
const { dir } = parse(dest)

try {
Expand All @@ -160,7 +163,7 @@ const duel = async args => {
}

return copyFile(file, dest)
}
},
//cp(file, join(subDir, relative(projectDir, file).replace(/^(\.\.\/)*/, ''))),
),
)
Expand Down
3 changes: 2 additions & 1 deletion test/integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { dirname, resolve, join } from 'node:path'
import { rm, readFile, rename } from 'node:fs/promises'
import { existsSync } from 'node:fs'
import { spawnSync, execSync } from 'node:child_process'
import { platform } from 'node:process'

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

Expand Down Expand Up @@ -119,7 +120,7 @@ describe('duel', () => {
const { status: statusEsm } = spawnSync(
'node',
['test/__fixtures__/esmProject/dist/index.js'],
{ stdio: 'inherit' },
{ stdio: 'inherit', shell: platform === 'win32' },
)
assert.equal(statusEsm, 0)
const { status: statusCjs } = spawnSync(
Expand Down

0 comments on commit cf0b6f6

Please sign in to comment.