Clean shared components test log#32759
Conversation
8a82a83 to
1f23267
Compare
|
|
||
| async function getLanguage(langPath: string): Promise<ICounterpartTranslation> { | ||
| console.log("Loading language from", langPath); | ||
| if (process.env.NODE_ENV !== "test") console.log("Loading language from", langPath); |
There was a problem hiding this comment.
IMO this is not a great approach, the test should define the console logs it doesn't care about and ignore. In certain tests this being spammed may be a red flag one wouldn't want to hide and cannot mutate the environment variable without breaking other things
There was a problem hiding this comment.
Hmm a solution is to add a env var to disable log related to language in SC tests. But enabled the log in i18n tests of SC
There was a problem hiding this comment.
I disagree, if our types were correct env would be inaccessible due to it being part of the node types and SC isn't designed for node but for the web.
There was a problem hiding this comment.
What do you suggest as solution?
There was a problem hiding this comment.
Like I stated initially
IMO this is not a great approach, the test should define the console logs it doesn't care about and ignore.
https://github.com/search?q=repo%3Aelement-hq%2Felement-web%20filterConsole&type=code
There was a problem hiding this comment.
Yep but this is spamming in all SC tests:
- we add the filter in every testsuite except i18n -> kind of burden to do it
- we put it globally in SC tests -> we lose this log in i18n
There was a problem hiding this comment.
we put it globally in SC tests -> we lose this log in i18n
Which is what this PR does already given it uses NODE_ENV which is the same for all tests
|
Replaced by #34184 |
This PR fixes:
Loading language fromin shared component test[Error: ResizeObserver loop completed with undelivered notifications.]was appearing on room list primary filter tests