Skip to content

Commit a606b93

Browse files
committed
fix: ai messing up tests
1 parent d85da57 commit a606b93

1 file changed

Lines changed: 0 additions & 24 deletions

File tree

  • packages/salesforcedx-aura-language-server/src/aura-indexer/__tests__

packages/salesforcedx-aura-language-server/src/aura-indexer/__tests__/indexer.spec.ts

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,6 @@ const isUnderWorkspace = (p: string): boolean => {
2525
return key === normRoot || key.startsWith(`${normRoot}/`);
2626
};
2727

28-
const matchGlob = (relativePath: string, pattern: string): boolean => {
29-
const rel = relativePath.replaceAll('\\', '/');
30-
if (pattern === '**') return true;
31-
if (pattern.startsWith('*/*.')) {
32-
const ext = pattern.slice(4);
33-
return /^[^/]+\/[^/]+$/.test(rel) && rel.endsWith(ext);
34-
}
35-
return false;
36-
};
37-
3828
// Normalize paths for cross-platform test consistency
3929
// Converts absolute paths to relative paths from the workspace root
4030
const normalize = (start: string, p: string): string => {
@@ -99,20 +89,6 @@ describe('indexer parsing content', () => {
9989
}
10090
});
10191

102-
jest
103-
.spyOn(sfdxFileSystemAccessor, 'findFilesWithGlobAsync')
104-
.mockImplementation((pattern: string, basePath: NormalizedPath) => {
105-
const normalizedBase = normalizePath(basePath);
106-
const relativePaths = getSfdxWorkspaceRelativePaths();
107-
const results: NormalizedPath[] = [];
108-
for (const rel of relativePaths) {
109-
const fullPath = normalizePath(path.join(SFDX_WORKSPACE_ROOT, rel));
110-
if (fullPath !== normalizedBase && !fullPath.startsWith(`${normalizedBase}/`)) continue;
111-
const relToBase = normalizePath(path.relative(normalizedBase, fullPath)).replaceAll('\\', '/');
112-
if (matchGlob(relToBase, pattern)) results.push(fullPath);
113-
}
114-
return Promise.resolve(results.length > 0 ? results : []);
115-
});
11692
});
11793

11894
it('aura indexer', async () => {

0 commit comments

Comments
 (0)