close

[Solved] react-testing-library: some portion of debug’s output is not visible

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error react-testing-library: some portion of debug’s output is not visible in reactJs. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How To Solve react-testing-library: some portion of debug’s output is not visible Error ?

  1. How To Solve react-testing-library: some portion of debug's output is not visible Error?

    To Solve react-testing-library: some portion of debug's output is not visible Error You need to change the value of DEBUG_PRINT_LIMIT env variable (default is 7000). For example, run your tests with DEBUG_PRINT_LIMIT=10000 yarn test.

  2. react-testing-library: some portion of debug's output is not visible

    To Solve react-testing-library: some portion of debug's output is not visible Error You need to change the value of DEBUG_PRINT_LIMIT env variable (default is 7000). For example, run your tests with DEBUG_PRINT_LIMIT=10000 yarn test.

Solution 1

You need to change the value of DEBUG_PRINT_LIMIT env variable (default is 7000).

For example, run your tests with: DEBUG_PRINT_LIMIT=10000 yarn test

Solution 2

I am using this version: “@testing-library/react”: “^11.0.4”

able to do just like below, we can change 300000 as the max length of output.

debug(undefined, 300000) 

Solution 4

The second argument of the debug() function can be used to set maxLengthToPrint.

E.g. to print everything in myElement using the recommended screen approach:

import {render, screen} from '@testing-library/react'

render(<MyComponent />);
const myElement = await screen.findByText(/someText/i);

const maxLengthToPrint = 100000
screen.debug(myElement, maxLengthToPrint);

Solution 5

This worked for me

const history = createMemoryHistory()
const { debug } = renderWithRedux(
    <Router history={history}>
        <SideBar />
    </Router>
, state);

screen.debug(debug(), 20000);

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read

Leave a Comment