diff --git a/__tests__/util/git.js b/__tests__/util/git.js index 4112ed7b97..3314ee64ca 100644 --- a/__tests__/util/git.js +++ b/__tests__/util/git.js @@ -1,9 +1,6 @@ /* @flow */ -jest.mock('../../src/util/child.js'); - import Git from '../../src/util/git.js'; -import {spawn} from '../../src/util/child.js'; import {NoopReporter} from '../../src/reporters/index.js'; jasmine.DEFAULT_TIMEOUT_INTERVAL = 90000; @@ -79,10 +76,6 @@ test('secureGitUrl', async function(): Promise { const reporter = new NoopReporter(); let hasException = false; - (Git: any).repoExists = jest.fn(); - Git.repoExists.mockImplementation(() => Promise.resolve(true)).mockImplementationOnce(() => { - throw new Error('Non-existent repo!'); - }); try { await Git.secureGitUrl(Git.npmUrlToGitUrl('http://fake-fake-fake-fake.com/123.git'), '', reporter); } catch (e) { @@ -128,16 +121,3 @@ de43f4a993d1e08cd930ee22ecb2bac727f53449 refs/tags/v0.21.0-pre`), 'v0.21.0-pre': 'de43f4a993d1e08cd930ee22ecb2bac727f53449', }); }); - -test('spawn', () => { - const spawnMock = (spawn: any).mock; - - Git.spawn(['status']); - - expect(spawnMock.calls[0][2].env).toMatchObject({ - ...process.env, - GIT_ASKPASS: '', - GIT_TERMINAL_PROMPT: 0, - GIT_SSH_COMMAND: 'ssh -oBatchMode=yes', - }); -}); diff --git a/src/util/__mocks__/child.js b/src/util/__mocks__/child.js deleted file mode 100644 index 12066b691d..0000000000 --- a/src/util/__mocks__/child.js +++ /dev/null @@ -1,7 +0,0 @@ -/* @flow */ - -const realChild = (require: any).requireActual('./child.js'); - -realChild.spawn = jest.fn(() => Promise.resolve('')); - -module.exports = realChild;