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.

UI not updating after test run

See original GitHub issue

Environment

  1. node -v: [8.9.4]

  2. npm -v: [6.1.0]

  3. npm ls jest or npm ls react-scripts (if you haven’t ejected): [jest@23.6.0]

  4. your vscode-jest settings if customized:

    • jest.pathToJest? [fill]
    • jest.pathToConfig? [fill]
    • anything else that you think might be relevant? [fill]
  5. Operating system: [OSX 10.13.6]

Prerequisite

  • are you able to run jest test from command line? [yes]
  • how do you run your tests from command line? (for example: npm run test or node_modules/.bin/jest) [npm run test]

Steps to Reproduce

  1. set jest.runAllTestsFirst to false
  2. restart
  3. go to test file and run jest using Jest: start runner
  4. go to output in the bottom drawer and select “jest”, observe that tests ARE running correctly
  5. observe that ui of code file is not updated at all (empty green circles indicating tests have not run even though they have)
  6. originally posted with error from console, but that was being caused by another plugin

Relevant Debug Info

this is happening when I don’t have runAllTestsFirst enabled (which is a non-starter for me because of the massive amounts of tests in this monolithic code base), and also when I do have runAllTestsFirst enabled, and then try to debug a test.

Expected Behavior

The UX of the code editor updates, showing filled green circles indicating tests ran. The UX shows an error message on lines where the test fails.

Actual Behavior

The tests can be observed to run in the output drawer, but it does not update in the code editor


The fastest (and the most fun) way to resolve the issue is to submit a pull-request yourself. If you are interested, feel free to check out the contribution guide, we look forward to seeing your PR…

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:11
  • Comments:8

github_iconTop GitHub Comments

2reactions
connectdotzcommented, Jul 4, 2019

@jeromesubs there might be some misunderstanding, this extension doesn’t read the terminal output as the attached image above seems indicated. Instead, it spawns its own node process to run jest according to jest.pathToJest setting. Therefore if you want it to execute npm run test, you will need to set "jest.pathToJest":"npm run test" in your “.vscode/settings.json”. You can see the output of the jest in the “Output” tab by clicking on the “Jest” status on the status-bar.

1reaction
advzrcommented, Aug 5, 2020

@counterbeing Same here. But I guess this is a bug of the extension because for Jest the tests with the same name are different tests. So maybe the extension should use some prefix to differentiate test names? For example something like this ${filePath}-${testLineNumberInFile}-${testName}.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Running Unit Tests does not update the Test Explorer UI
After updating Test. SDK, the NUnit test adapter and Visual Studio to the latest versions the issue has been resolved. A fix for...
Read more >
Input not updating on react testing library, thus test failing ...
This works on the actual app, i type in inputA, and inputB gets updated. When ome types on inputA, an action is dispatched...
Read more >
Reviewing test results and updating the baseline - Applitools
After a test run completes, you will typically want to review the results to see which checkpoints matched baseline images and which did...
Read more >
Known issues with Android Studio and Android Gradle Plugin
Running JUnit tests may compile the code twice · To fix the issue for the current project, click Run > Edit Configurations and...
Read more >
UILabel not updating with new value | Apple Developer Forums
Note also that those UI updates may be stored for later execution in the main thread, all at once. Don't forget to mark...
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