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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jest crashes if __snapshot__ folder gets removed #9331

Closed
simonwep opened this issue Dec 20, 2019 · 6 comments
Closed

Jest crashes if __snapshot__ folder gets removed #9331

simonwep opened this issue Dec 20, 2019 · 6 comments

Comments

@simonwep
Copy link

馃悰 Bug Report

If you're using snapshots and remove the folder while jest is idle (Using it with the --watchwatchAll flag) the process crashes. Not sure if this is related to jest though.

To Reproduce

Use jest with the --watchAll flag and remove the __snapshots__ folder after a test is done.

Expected behavior

It could just tell me that the __snapshots__ is not longer available and recreate it.

Link to repo

Here you go: jest-error-snapshots-folder-removed.

It fails here. I've used fs-extra but you can remove it manually too via your file-explorer.

envinfo

    OS: Windows 10 10.0.18362
    CPU: (16) x64 AMD Ryzen 7 1700X Eight-Core Processor
  Binaries:
    Node: 10.16.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.17.3 - C:\Users\root\AppData\Roaming\npm\yarn.CMD
    npm: 6.13.1 - C:\Program Files\nodejs\npm.CMD
  npmPackages:
    jest: ^24.9.0 => 24.9.0
@Mark1626
Copy link
Contributor

Seems to work in properly in my Mac

   OS: macOS Mojave 10.14.6
  Binaries:
    Node: 10.16.0 
    Yarn: 1.13.0
  npmPackages:
    jest: 24.9.0

@Mark1626
Copy link
Contributor

Issue seems to be only in Windows. Ran it in a Windows 10 VM and got this

Watch Usage: Press w to show more.events.js:187
      throw er; // Unhandled 'error' event
      ^

Error: EPERM: operation not permitted, lstat 'C:\cygwin64\home\<user>\jest-error-snapsho
ts-folder-removed\test\__snapshots__\index.test.js.snap'
Emitted 'error' event on NodeWatcher instance at:
    at NodeWatcher.<anonymous> (C:\cygwin64\home\<user>\jest-error-snapshots-folder-remo
ved\node_modules\sane\src\node_watcher.js:291:16)
    at callback (C:\cygwin64\home\<user>\jest-error-snapshots-folder-removed\node_module
s\graceful-fs\polyfills.js:295:20)
    at FSReqCallback.oncomplete (fs.js:158:21) {
  errno: -4048,
  code: 'EPERM',
  syscall: 'lstat',
  path: 'C:\\cygwin64\\home\\<user>\\jest-error-snapshots-folder-removed\\test\\__snapsh
ots__\\index.test.js.snap'
}

@simonwep
Copy link
Author

@M4rk9696 Yep, that's exactly the error I get. Should've posted it below my question...

@github-actions
Copy link

This issue is stale because it has been open for 1 year with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the Stale label Feb 17, 2023
@github-actions
Copy link

This issue was closed because it has been stalled for 30 days with no activity. Please open a new issue if the issue is still relevant, linking to this one.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 19, 2023
@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants