Skip to content

Conversation

@takahirox
Copy link
Collaborator

@takahirox takahirox commented Nov 29, 2020

Related issue: #20760

Description

I suggested in #20760 that we should resolve the root issues of console warnings caused in the unit tests and make the result log clearer.

But as @Mugen87 mentioned, some of them are on purpose. They test the code path including console warnings. And he suggested we could consider to monkey-patch console to prevent such console warnings.

This PR adds an easy console wrapper to introduce logging level to console for the unit tests to prevent console warning when we test the code path including console warnings as I suggested

Example:

const c = new Color();
console.level = CONSOLE_LEVEL.ERROR;
c.setStyle( 'rgba(255,0,0,0.5)' );
console.level = CONSOLE_LEVEL.DEFAULT;

Let me know if there is any nicer ways or existing libraries.

@mrdoob mrdoob added this to the r124 milestone Nov 30, 2020
@mrdoob mrdoob merged commit e161c46 into mrdoob:dev Nov 30, 2020
@mrdoob
Copy link
Owner

mrdoob commented Nov 30, 2020

Thanks!

@takahirox takahirox deleted the ConsoleLoggingLevel branch November 30, 2020 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants