also looking at this
fix: restore HTTP interception between Jest environments
#2
2 files
+10
-0
| @@ -0,0 +1,9 @@ | ||
| 1 | import nock from 'nock'; | |
| 2 | ||
| 3 | // Built-in HTTP modules survive Jest environments reused in the same worker. | |
| 4 | // Restore Nock before that environment is disposed, so the next one owns its hooks. | |
| 5 | afterAll(() => { | |
| 6 | nock.abortPendingRequests(); | |
| 7 | nock.cleanAll(); | |
| 8 | nock.restore(); | |
| 9 | }); | |