The [setup example for adding custom queries globally](https://testing-library.com/docs/react-testing-library/setup#add-custom-queries) for (at least) React seems to break `screen`-specific functionality such as `screen.debug()`. If I understand correctly (via https://github.com/testing-library/dom-testing-library/issues/516#issuecomment-1025096164) this bit: ``` const customScreen = within(document.body, allQueries) ``` should be something like this: ``` const customScreen = { ...screen, ...within(document.body, allQueries) }; ``` And of course that means you have to import `screen`, too.