Skip to content

Commit

Permalink
chore: move forgotten tap test
Browse files Browse the repository at this point in the history
  • Loading branch information
Jahed Ahmed committed Jan 25, 2022
1 parent 8aa6f60 commit 2e7a052
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 67 deletions.
2 changes: 1 addition & 1 deletion src/cli/commands/test/utils.ts
Expand Up @@ -2,7 +2,7 @@ import { TestResult } from '../../../lib/snyk-test/legacy';

export function getPathWithOptionalProjectName(
currPath: string,
testResult: TestResult,
testResult: Pick<TestResult, 'projectName'>,
): string {
let projectName = testResult.projectName;
if (projectName) {
Expand Down
66 changes: 0 additions & 66 deletions test/commands/test/utils.test.ts

This file was deleted.

24 changes: 24 additions & 0 deletions test/jest/unit/cli/commands/test/utils.spec.ts
@@ -0,0 +1,24 @@
import { getPathWithOptionalProjectName } from '../../../../../../src/cli/commands/test/utils';

describe('getPathWithOptionalProjectName', () => {
test.each([
{
projectName: '',
},
{
projectName: 'anything',
},
])('returns given path', () => {
const result = getPathWithOptionalProjectName('/tmp/hydra', {
projectName: '',
});
expect(result).toEqual('/tmp/hydra');
});

test('appends subdirectory from project name', () => {
const result = getPathWithOptionalProjectName('/tmp/hydra', {
projectName: 'anything/subdir',
});
expect(result).toEqual('/tmp/hydra/subdir');
});
});

0 comments on commit 2e7a052

Please sign in to comment.