Skip to content

Commit

Permalink
Fix tests for #414
Browse files Browse the repository at this point in the history
  • Loading branch information
NullVoxPopuli committed Nov 6, 2024
1 parent b211b6e commit 79e9ecc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/utils/layout-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export function getPodModulePrefix(root: string): string | null {
return podModulePrefix.trim().length > 0 ? podModulePrefix : null;
}

function getRoot(fromDir: string) {
export function getRoot(fromDir: string) {
try {
const topLevel = childProcess.execSync('git rev-parse --show-toplevel', { encoding: 'utf8', cwd: fromDir });

Expand Down
6 changes: 4 additions & 2 deletions test/utils/layout-helpers-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,13 @@ describe('definition-helpers', function () {
it('return package root folder', async function () {
const resultOne = await resolvePackageRoot(__dirname, 'lodash');

expect(resultOne).toContain(path.sep + 'lodash');
// no lodash here.
expect(resultOne).toBe(false);

const resultTwo = await resolvePackageRoot(__dirname, 'memoizee');

expect(resultTwo).toContain(path.sep + 'memoizee');
// memoizee also does not exist
expect(resultTwo).toBe(false);
});
});

Expand Down

0 comments on commit 79e9ecc

Please sign in to comment.