Skip to content

Commit

Permalink
Revert "Update: add regression tests for Git.spawn env issues (#3759)"
Browse files Browse the repository at this point in the history
This reverts commit cd26fec.
  • Loading branch information
bestander authored Jun 30, 2017
1 parent 37106a1 commit 3257cdf
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 27 deletions.
20 changes: 0 additions & 20 deletions __tests__/util/git.js
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -79,10 +76,6 @@ test('secureGitUrl', async function(): Promise<void> {
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) {
Expand Down Expand Up @@ -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',
});
});
7 changes: 0 additions & 7 deletions src/util/__mocks__/child.js

This file was deleted.

0 comments on commit 3257cdf

Please sign in to comment.