|
2 | 2 | // But this added complexity greatly speeds up the other npm-related tests by removing the |
3 | 3 | // dependency on actual npm CLI calls and a fake registry (which are very slow). |
4 | 4 |
|
5 | | -import { afterAll, afterEach, beforeAll, describe, expect, it, jest } from '@jest/globals'; |
| 5 | +import { afterEach, beforeAll, describe, expect, it, jest } from '@jest/globals'; |
6 | 6 | import fs from 'fs'; |
7 | 7 | // import fetch from 'npm-registry-fetch'; |
8 | 8 | import { type NpmResult, npm } from '../packageManager/npm'; |
@@ -208,10 +208,6 @@ describe('_mockNpmPublish', () => { |
208 | 208 | packageJson = undefined; |
209 | 209 | }); |
210 | 210 |
|
211 | | - afterAll(() => { |
212 | | - jest.restoreAllMocks(); |
213 | | - }); |
214 | | - |
215 | 211 | it('throws if cwd is not specified', async () => { |
216 | 212 | await expect(() => _mockNpmPublish({}, [], { cwd: undefined })).rejects.toThrow( |
217 | 213 | 'cwd is required for mock npm publish' |
@@ -311,10 +307,6 @@ describe('_mockNpmPack', () => { |
311 | 307 | writtenFiles = []; |
312 | 308 | }); |
313 | 309 |
|
314 | | - afterAll(() => { |
315 | | - jest.restoreAllMocks(); |
316 | | - }); |
317 | | - |
318 | 310 | it('throws if cwd is not specified', async () => { |
319 | 311 | await expect(() => _mockNpmPack({}, [], { cwd: undefined })).rejects.toThrow('cwd is required for mock npm pack'); |
320 | 312 | }); |
@@ -370,10 +362,6 @@ describe('mockNpm', () => { |
370 | 362 | packageJson = undefined; |
371 | 363 | }); |
372 | 364 |
|
373 | | - afterAll(() => { |
374 | | - jest.restoreAllMocks(); |
375 | | - }); |
376 | | - |
377 | 365 | // describe('mockFetchJson', () => { |
378 | 366 | // it('mocks registry fetch', async () => { |
379 | 367 | // npmMock.setRegistryData({ foo: { versions: ['1.0.0'] } }); |
|
0 commit comments