stackblitz / webcontainer-core

Dev environments. In your web app.
https://webcontainers.io
MIT License
3.77k stars 142 forks source link

Running Jest or Vitest in Webcontainers doesn't exit with status 1 #1305

Open PhantomKnight287 opened 7 months ago

PhantomKnight287 commented 7 months ago

Describe the bug

I installed jest in a new nodejs webcontainer and wrote a basic test that fails. I ran it using yarn jest and jest didn't exit with status 0

Link to the blitz that caused the error

https://stackblitz.com/edit/stackblitz-starters-kdtmv1?description=Starter%20project%20for%20Node.js,%20a%20JavaScript%20runtime%20built%20on%20Chrome%27s%20V8%20JavaScript%20engine&file=test.spec.ts&title=node.new%20Starter

Steps to reproduce

- Run `yarn jest` in terminal
- The yarn doesn't show the `error Command failed with exit code 1.` instead shows `Done in 2.05s` 

### Expected behavior

It should throw status 1

### Parity with Local

- [X] I have [run the project in my local machine](https://github.com/stackblitz/webcontainer-core/blob/main/repro.md#try-locally) and I could not reproduce the issue.

### Screenshots

![image](https://github.com/stackblitz/webcontainer-core/assets/76196237/ec114b35-1d35-4f94-aee6-8c5cbb9125bf)
![image](https://github.com/stackblitz/webcontainer-core/assets/76196237/3a5dfef3-14ff-4aa8-a20d-e3bbe6056469)

### Platform

Browser name = Chrome Full version = 120.0.0.0 Major version = 120 navigator.appName = Netscape navigator.userAgent = Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 performance.memory = { "totalJSHeapSize": 128021926, "usedJSHeapSize": 107930550, "jsHeapSizeLimit": 4294705152 } Hash = 3f7046a7



### Additional context

_No response_
jrvidal commented 7 months ago

Thanks for the report, it does seem we deviate from the expected behavior.