Skip to content

Commit e6ad229

Browse files
committed
Refactor: improve full scan manifest test
1 parent 0b0b651 commit e6ad229

File tree

1 file changed

+3
-23
lines changed

1 file changed

+3
-23
lines changed

componentDetection.test.ts

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,6 @@ test('full action scan creates manifests with correct names and file source loca
221221
expect(manifests).toBeDefined();
222222
expect(manifests!.length).toBeGreaterThan(0);
223223

224-
// Ensure no manifest names have leading slashes
225224
for (const manifest of manifests!) {
226225
expect(manifest.name.startsWith('/')).toBe(false);
227226
}
@@ -234,34 +233,15 @@ test('full action scan creates manifests with correct names and file source loca
234233
'environment.yaml'
235234
];
236235

237-
// Create a lookup for manifests by name
238236
const manifestsByName = manifests!.reduce((acc, manifest) => {
239237
acc[manifest.name] = manifest;
240238
return acc;
241239
}, {} as Record<string, any>);
242240

243-
// Check each expected manifest if it exists
244241
for (const expectedName of expectedManifestNames) {
245242
const manifest = manifestsByName[expectedName];
246-
if (manifest) {
247-
expect(manifest.name).toBe(expectedName);
248-
expect(manifest.file?.source_location).toBe(expectedName);
249-
}
250-
}
251-
252-
// Verify specific expected manifests exist with correct properties
253-
if (manifestsByName['package.json']) {
254-
expect(manifestsByName['package.json'].name).toBe('package.json');
255-
expect(manifestsByName['package.json'].file?.source_location).toBe('package.json');
256-
}
257-
258-
if (manifestsByName['nested/package.json']) {
259-
expect(manifestsByName['nested/package.json'].name).toBe('nested/package.json');
260-
expect(manifestsByName['nested/package.json'].file?.source_location).toBe('nested/package.json');
261-
}
262-
263-
if (manifestsByName['environment.yaml']) {
264-
expect(manifestsByName['environment.yaml'].name).toBe('environment.yaml');
265-
expect(manifestsByName['environment.yaml'].file?.source_location).toBe('environment.yaml');
243+
expect(manifest).toBeDefined();
244+
expect(manifest.name).toBe(expectedName);
245+
expect(manifest.file?.source_location).toBe(expectedName);
266246
}
267247
}, 15000);

0 commit comments

Comments
 (0)