Skip to content

Commit c5b04f4

Browse files
committed
Add increase debuggability to tests
1 parent c9e897b commit c5b04f4

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

src/__tests__/queries.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,16 @@ test('findByText should throw errors', async () => {
2121
})
2222

2323
test('queryByText should find text', async () => {
24-
const {queryByText} = await render('node', [
24+
jest.setTimeout(15000)
25+
const props = await render('node', [
2526
resolve(__dirname, './execute-scripts/list-args.js'),
2627
'--version',
27-
])
28+
], {debug: true})
29+
30+
const {queryByText} = props;
2831

2932
expect(await queryByText('--version')).toBeTruthy()
33+
jest.setTimeout(5000)
3034
})
3135

3236
test('queryByText should not throw errors', async () => {

src/pure.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ async function render(
7070
}
7171
})
7272

73+
if (opts.debug) {
74+
exec.stdout.pipe(process.stdout)
75+
}
76+
7377
await execOutputAPI._isReady
7478

7579
setCurrentInstance(execOutputAPI);

types/pure.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import {Readable, Writable} from 'node:stream'
22

33
export interface RenderOptions {
4-
cwd: string
4+
cwd: string,
5+
debug: boolean
56
}
67

78
/**

0 commit comments

Comments
 (0)