Skip to content

Commit 1076781

Browse files
cogwirrelclaude
andcommitted
cleanup(misc): make isCurrentDirReference private, remove its tests
The helper is a simple internal utility that doesn't need to be exported or independently tested — it's already covered by determineFolder and resolveSpecialFolderName tests. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent d69d4b1 commit 1076781

2 files changed

Lines changed: 1 addition & 24 deletions

File tree

packages/create-nx-workspace/bin/create-nx-workspace.spec.ts

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import {
22
validateWorkspaceName,
33
resolveSpecialFolderName,
44
determineFolder,
5-
isCurrentDirReference,
65
} from './create-nx-workspace';
76
import { CnwError } from '../src/utils/error-utils';
87
import { mkdtempSync, mkdirSync, rmSync, realpathSync } from 'fs';
@@ -45,23 +44,6 @@ describe('validateWorkspaceName', () => {
4544
});
4645
});
4746

48-
describe('isCurrentDirReference', () => {
49-
it('should return true for "."', () => {
50-
expect(isCurrentDirReference('.')).toBe(true);
51-
});
52-
53-
it('should return true for "./"', () => {
54-
expect(isCurrentDirReference('./')).toBe(true);
55-
});
56-
57-
it('should return false for regular names', () => {
58-
expect(isCurrentDirReference('myapp')).toBe(false);
59-
expect(isCurrentDirReference('.hidden')).toBe(false);
60-
expect(isCurrentDirReference('../parent')).toBe(false);
61-
expect(isCurrentDirReference('./subdir')).toBe(false);
62-
});
63-
});
64-
6547
describe('determineFolder', () => {
6648
let originalCwd: string;
6749

packages/create-nx-workspace/bin/create-nx-workspace.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -833,12 +833,7 @@ export function validateWorkspaceName(name: string): void {
833833
}
834834
}
835835

836-
/**
837-
* Returns `true` when the folder name refers to the current directory.
838-
*
839-
* @visibleForTesting
840-
*/
841-
export function isCurrentDirReference(folderName: string): boolean {
836+
function isCurrentDirReference(folderName: string): boolean {
842837
return folderName === '.' || folderName === './';
843838
}
844839

0 commit comments

Comments
 (0)