Skip to content

Commit

Permalink
Remove tests for the legacy simple-git/promise
Browse files Browse the repository at this point in the history
  • Loading branch information
steveukx committed Aug 11, 2022
1 parent a6168ae commit 7fe88a3
Show file tree
Hide file tree
Showing 17 changed files with 97 additions and 480 deletions.
7 changes: 0 additions & 7 deletions simple-git/test/__fixtures__/instance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,3 @@ export function newSimpleGit(...args: [] | [string] | [Partial<SimpleGitOptions>
const simpleGit = require('../..');
return simpleGit(...args);
}

export function newSimpleGitP(baseDir: unknown | string = '/tmp/example-repo') {
if (typeof baseDir !== 'string') {
throw new Error('Bad arguments to newSimpleGitP');
}
return require('../../promise')(baseDir);
}
79 changes: 0 additions & 79 deletions simple-git/test/consumer/ts-default-from-root.spec.ts

This file was deleted.

36 changes: 0 additions & 36 deletions simple-git/test/consumer/ts-gitp-from-root.spec.ts

This file was deleted.

41 changes: 0 additions & 41 deletions simple-git/test/consumer/ts-promise-consumer.spec.ts

This file was deleted.

14 changes: 0 additions & 14 deletions simple-git/test/consumer/tsconfig-promise.json

This file was deleted.

13 changes: 0 additions & 13 deletions simple-git/test/consumer/tsconfig-standard.json

This file was deleted.

18 changes: 1 addition & 17 deletions simple-git/test/integration/bad-initial-path.spec.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import { promiseError } from '@kwsites/promise-result';
import {
assertGitError,
createTestContext,
like,
newSimpleGit,
newSimpleGitP,
SimpleGitTestContext,
} from '../__fixtures__';

Expand All @@ -15,24 +13,10 @@ describe('bad initial path', () => {

beforeEach(async () => (context = await createTestContext()));

it('simple-git/promise', async () => {
const baseDir = context.path('foo');
const git = newSimpleGitP(baseDir);

const errorInstance = await promiseError(git.init());
assertGitError(errorInstance, `does not exist`, GitConstructError);
expect(errorInstance).toHaveProperty(
'config',
like({
baseDir,
})
);
});

it('simple-git', async () => {
const baseDir = context.path('foo');

let errorInstance: Error | undefined;
let errorInstance: Error | unknown;
try {
newSimpleGit(baseDir);
} catch (e) {
Expand Down
4 changes: 0 additions & 4 deletions simple-git/test/integration/broken-chains.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {
assertGitError,
createTestContext,
newSimpleGit,
newSimpleGitP,
SimpleGitTestContext,
} from '../__fixtures__';
import { SimpleGit } from '../../typings';
Expand All @@ -24,9 +23,6 @@ describe('broken-chains', () => {

beforeEach(async () => (context = await createTestContext()));

it('promise chains from legacy promise api', () =>
testPromiseChains(newSimpleGitP(context.root)));

it('promise chains from main api', () => testPromiseChains(newSimpleGit(context.root)));

/* When many tasks are called as a chain (ie: `git.init().addRemote(...).fetch()`) the
Expand Down
5 changes: 0 additions & 5 deletions simple-git/test/integration/merge-integration.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
FIRST_BRANCH,
like,
newSimpleGit,
newSimpleGitP,
SECOND_BRANCH,
setUpConflicted,
setUpInit,
Expand Down Expand Up @@ -38,10 +37,6 @@ describe('merge', () => {
await singleFileConflict(newSimpleGit(context.root));
});

it('single file conflict: gitP', async () => {
await singleFileConflict(newSimpleGitP(context.root));
});

it('multiple files conflicted', async () => {
const git = newSimpleGit(context.root);

Expand Down
7 changes: 0 additions & 7 deletions simple-git/test/integration/tag.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import {
createTestContext,
like,
newSimpleGit,
newSimpleGitP,
setUpFilesAdded,
setUpInit,
SimpleGitTestContext,
Expand All @@ -17,12 +16,6 @@ describe('tag', () => {
await setUpFilesAdded(context, ['foo', 'bar']);
});

it('deprecated(gitP) creates and gets the current named tag', async () => {
const git = newSimpleGitP(context.root);
expect(await git.addTag('newTag')).toEqual({ name: 'newTag' });
expect(String(await git.tag()).trim()).toBe('newTag');
});

it('creates and gets the current named tag', async () => {
const git = newSimpleGit(context.root);
expect(await git.addTag('newTag')).toEqual({ name: 'newTag' });
Expand Down
Loading

0 comments on commit 7fe88a3

Please sign in to comment.