Skip to content

Commit

Permalink
fix(tests): fix getByText tests
Browse files Browse the repository at this point in the history
  • Loading branch information
crutchcorn committed Nov 2, 2021
1 parent 49579a9 commit 709cf62
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/__tests__/queries.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const {resolve} = require('path')
const {render} = require('../pure')
const {waitFor} = require("../wait-for");

test('findByText should find text', async () => {
const {findByText} = await render('node', [
Expand Down Expand Up @@ -43,7 +44,7 @@ test('getByText should find text', async () => {
'--version',
])

expect(getByText('--version')).toBeTruthy();
expect(await waitFor(() => getByText('--version'))).toBeTruthy();
})

test('getByText should throw errors', async () => {
Expand All @@ -52,5 +53,5 @@ test('getByText should throw errors', async () => {
'--version',
])

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

0 comments on commit 709cf62

Please sign in to comment.