stable

Clone or download

Read-only

Jest tests should be marked as failed when console.error() or console.warn() is used

For example Vue complains when a directive can not be found using console.warn() but continue the execution. In this situation the test should be marked as failed because there is something not expected going on. The solution is extracted from [0]. [0] https://github.com/facebook/jest/issues/6121 Part of request #13806: Use Jest as the default test framework for JS unit tests Change-Id: I3e88eb41c9a1acbe0e7698f6a53f08453e7f5950

Modified Files

Name
M .eslintrc.js +1 −1 Go to diff View file
A tests/jest/fail-console-error-warning.js +40 −0 Go to diff View file
M tests/jest/jest.config.js +1 −0 Go to diff View file