Skip to content

Commit

Permalink
Tweak tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aryaemami59 committed Jan 29, 2025
1 parent 928b621 commit d52aaa5
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion test/experimental-dts.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,23 @@ test('experimentalDts works when `entry` is set to an array', async ({

const cwd = path.dirname(outDir)

const promiseWithChild = execFile('pnpm', ['pack'], {
cwd,
shell: true,
})

await expect(promiseWithChild).resolves.not.toThrow()

const { stdout } = await promiseWithChild

const packedName = stdout.trim().split('\n').pop()

if (!packedName) {
throw new Error('No package name found')
}

await expect(
execFile('npx', ['-y', '@arethetypeswrong/cli', '-P'], {
execFile('npx', ['-y', '@arethetypeswrong/cli', packedName], {
cwd,
shell: true,
}),
Expand Down Expand Up @@ -776,24 +791,28 @@ test(
await expect(
execFile('node', [path.resolve(__dirname, '../dist/cli-default.js')], {
cwd: 'test/.cache/check-bundled-type-definitions/my-lib',
shell: true,
}),
).resolves.not.toThrow()

await expect(
execFile('pnpm', ['pack'], {
cwd: 'test/.cache/check-bundled-type-definitions/my-lib',
shell: true,
}),
).resolves.not.toThrow()

await expect(
execFile('pnpm', ['install'], {
cwd: 'test/.cache/check-bundled-type-definitions/consuming-library',
shell: true,
}),
).resolves.not.toThrow()

await expect(
execFile('tsc', ['-p', 'tsconfig.json'], {
cwd: 'test/.cache/check-bundled-type-definitions/consuming-library',
shell: true,
}),
).resolves.not.toThrow()
},
Expand Down

0 comments on commit d52aaa5

Please sign in to comment.