question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Should provide test env in verbose test report

See original GitHub issue

Update: Repurposed bug to feature

🚀 Feature Proposal

Display testEnvironment value in test output report on a per test file basis.

Motivation

To clearly see what env is used for each test file.

Example

 PASS  foo.test.js (6.252s) (jest-environment-jsdom)
  ✓ should be true
 PASS  bar.test.js (3.122s) (jest-environment-node)
  ✓ should be true

Pitch

It can sometimes be important to see test env used to run your tests. For example, if you have tests for code which run on both node & browser. Having at least the report of what env was used for which test - is valuable from a maintenance perspective.

Notes

Should this be on by default, or only when verbose: true?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:4
  • Comments:19 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
rickhanloniicommented, Dec 24, 2018

Yes @SimenB that’s what I meant, the reporter would strip jest-environment

I feel strongly that we should only print the env in the default reporter if there are multiple detected

If that’s too difficult to achieve then I’d recommend providing the info to reporters and using a custom reporter to display it always

0reactions
github-actions[bot]commented, Apr 30, 2022

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using .env files for unit testing with jest - Stack Overflow
I'm looking to run a series of tests on it like so: // unit tests for env file describe('env', () => { it('should...
Read more >
Configuring Jest
If a given module's path matches any of the patterns, it will not be require() -able in the test environment. These pattern strings...
Read more >
Unit test reports - GitLab Docs
A unit test report can appear to be empty when viewed in a merge request if the artifact that contained the report expires....
Read more >
Basic patterns and examples — pytest documentation
Adding info to test report header¶ ... It is also possible to return a list of strings which will be considered as several...
Read more >
Collecting test data - CircleCI
You can choose to upload your test results using both store_test_results and store_artifacts . · Make sure that your path value is not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found