diff --git a/packager/src/Bundler/__tests__/Bundler-test.js b/packager/src/Bundler/__tests__/Bundler-test.js index dd13c5ea9..9735ed3f5 100644 --- a/packager/src/Bundler/__tests__/Bundler-test.js +++ b/packager/src/Bundler/__tests__/Bundler-test.js @@ -359,15 +359,25 @@ describe('Bundler', function() { ])); }); - it('return correct number of workers', () => { - os.cpus.mockReturnValue({length: 1}); - expect(Bundler.getMaxWorkerCount()).toBe(1); - os.cpus.mockReturnValue({length: 8}); - expect(Bundler.getMaxWorkerCount()).toBe(6); - os.cpus.mockReturnValue({length: 24}); - expect(Bundler.getMaxWorkerCount()).toBe(14); - process.env.REACT_NATIVE_MAX_WORKERS = 5; - expect(Bundler.getMaxWorkerCount()).toBe(5); + describe('number of workers', () => { + beforeEach(() => { + delete process.env.REACT_NATIVE_MAX_WORKERS; + }); + + afterEach(() => { + delete process.env.REACT_NATIVE_MAX_WORKERS; + }); + + it('return correct number of workers', () => { + os.cpus.mockReturnValue({length: 1}); + expect(Bundler.getMaxWorkerCount()).toBe(1); + os.cpus.mockReturnValue({length: 8}); + expect(Bundler.getMaxWorkerCount()).toBe(6); + os.cpus.mockReturnValue({length: 24}); + expect(Bundler.getMaxWorkerCount()).toBe(14); + process.env.REACT_NATIVE_MAX_WORKERS = 5; + expect(Bundler.getMaxWorkerCount()).toBe(5); + }); }); }); });