Skip to content

fix(screen): broken link when there's no document #764

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/__node_tests__/screen.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ test('the screen export throws a helpful error message when no global document i
expect(() =>
screen.getByText(/hello world/i),
).toThrowErrorMatchingInlineSnapshot(
`"For queries bound to document.body a global document has to be available... Learn more: https://testing-library.com/s/screen-global-error"`,
`"For queries bound to document.body a global document has to be available... Learn more: https://testing-library.com/docs/dom-testing-library/api-queries#screen"`,
)
})
2 changes: 1 addition & 1 deletion src/screen.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const screen =
(helpers, key) => {
helpers[key] = () => {
throw new TypeError(
'For queries bound to document.body a global document has to be available... Learn more: https://testing-library.com/s/screen-global-error',
'For queries bound to document.body a global document has to be available... Learn more: https://testing-library.com/docs/dom-testing-library/api-queries#screen',
)
}
return helpers
Expand Down