Skip to content

Commit 709cf62

Browse files
committed
fix(tests): fix getByText tests
1 parent 49579a9 commit 709cf62

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/__tests__/queries.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const {resolve} = require('path')
22
const {render} = require('../pure')
3+
const {waitFor} = require("../wait-for");
34

45
test('findByText should find text', async () => {
56
const {findByText} = await render('node', [
@@ -43,7 +44,7 @@ test('getByText should find text', async () => {
4344
'--version',
4445
])
4546

46-
expect(getByText('--version')).toBeTruthy();
47+
expect(await waitFor(() => getByText('--version'))).toBeTruthy();
4748
})
4849

4950
test('getByText should throw errors', async () => {
@@ -52,5 +53,5 @@ test('getByText should throw errors', async () => {
5253
'--version',
5354
])
5455

55-
expect(() => getByText('--nothing')).toThrow('Unable to find an stdout line with the text:');
56+
await expect(() => waitFor(() => getByText('--nothing'))).rejects.toThrow('Unable to find an stdout line with the text:');
5657
})

0 commit comments

Comments
 (0)