Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom error reporters #15

Closed
gadicc opened this issue Feb 5, 2021 · 3 comments
Closed

Custom error reporters #15

gadicc opened this issue Feb 5, 2021 · 3 comments

Comments

@gadicc
Copy link
Owner

gadicc commented Feb 5, 2021

@pudgereyem on #14:

Custom jest reporters prevent --verbose to output individual tests

I like to run jest --verbose so that I can see the results of the individual tests when working. However, the custom reporters that was added, see code here prevents that behaviour. In order to see the individual tests (as shown in the above section) I had to comment out those. See below.

// jest.config.js

module.exports = {
  preset: 'ts-jest',
  setupFilesAfterEnv: [
    "<rootDir>/tests/setupTests.js"
  ],
  testEnvironment: 'node',
  testPathIgnorePatterns: [
    "/node_modules/",
    "/api/"
  ],
  // reporters: [
  //   '<rootDir>/tests/reporter.js',
  //   '<rootDir>/tests/summary-reporter.js',
  // ],
};

What are your thoughts on this? I personally appreciate seeing what different tests are running.

@gadicc
Copy link
Owner Author

gadicc commented Feb 5, 2021

Ahh, I thought something had changed with the tests but couldn't put a finger on it 😅

Ok, so the customer error reporter hides console output for passing tests.

This is because e.g. we have a lot of tests that test failing validation, and you've seen how much console output that generates. (So you can imagine how I didn't notice the missing test names after getting rid of thousands other lines 😅)

Clearly an unintended consequence is that it's hiding the console output that lists the name of the test itself.

I think the solution is actually to drop the custom reporter and look into a way to disable console output temporarily just for those specific tests. Will report back.

@pudgereyem
Copy link
Contributor

@gadicc, yes I could see what you tried to do there. I agree that it's a good idea to drop the custom reporter for now and then solve that problem you presented without unexpected side effects 👍

@gadicc
Copy link
Owner Author

gadicc commented Feb 5, 2021

Great, it's done! 🎉

@gadicc gadicc closed this as completed Feb 5, 2021
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

No branches or pull requests

2 participants