Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Update: add regression tests for Git.spawn env issues" #3768

Merged
merged 3 commits into from
Jun 30, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.