You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was trying to use the environment variable, DEBUG_PRINT_LIMIT, to limit the length of the HTML printed to console in case of failure.
But for some reasons, the variable environment is just ignored by the library...
Now when I run DEBUG_PRINT_LIMIT=10 npm test, the environment variable is just ignored since it prints me the whole HTML instead of just 10 characters...
I tried many things: setting the environment variable in the package.json file, or directly in my code, but nothing works, the variable is just ignored.
However if I change the code of the library (file pptr-testing-library/dom-testing-library.js), and I replace process.env.DEBUG_PRINT_LIMIT || 7000 with process.env.DEBUG_PRINT_LIMIT || 10, then it works! So it seems that for some reason the environment variable is not passed correctly to the library.
I'm using node version 12 on a Debian machine (I think it doesn't change anything though).
Is it a bug in the library or am I doing something wrong?
Thanks
The text was updated successfully, but these errors were encountered:
So it seems that for some reason the environment variable is not passed correctly to the library.
Correct this library does not even attempt to pass environment variables through. dom-testing-library is executed inside the browser context which does not have any access to the environment variables in node.
We'd accept a PR that injected relevant variables though :)
I was trying to use the environment variable, DEBUG_PRINT_LIMIT, to limit the length of the HTML printed to console in case of failure.
But for some reasons, the variable environment is just ignored by the library...
My project:
package.json
main.test.js
Now when I run
DEBUG_PRINT_LIMIT=10 npm test
, the environment variable is just ignored since it prints me the whole HTML instead of just 10 characters...I tried many things: setting the environment variable in the package.json file, or directly in my code, but nothing works, the variable is just ignored.
However if I change the code of the library (file pptr-testing-library/dom-testing-library.js), and I replace process.env.DEBUG_PRINT_LIMIT || 7000 with process.env.DEBUG_PRINT_LIMIT || 10, then it works! So it seems that for some reason the environment variable is not passed correctly to the library.
I'm using node version 12 on a Debian machine (I think it doesn't change anything though).
Is it a bug in the library or am I doing something wrong?
Thanks
The text was updated successfully, but these errors were encountered: