Merge pull request #21041 from backstage/freben/collect-race

try to fix the flaky config collector test
This commit is contained in:
Fredrik Adelöw
2023-11-07 17:09:23 +01:00
committed by GitHub
@@ -277,30 +277,32 @@ describe('collectConfigSchemas', () => {
});
process.chdir(mockDir.path);
await expect(collectConfigSchemas(['a'], [])).resolves.toEqual([
{
path: path.join('node_modules', 'a', 'package.json'),
value: mockSchema,
},
{
path: path.join('node_modules', 'b', 'package.json'),
value: { ...mockSchema, title: 'b' },
},
{
path: path.join('node_modules', 'c', 'package.json'),
value: { ...mockSchema, title: 'c1' },
},
{
path: path.join(
'node_modules',
'b',
'node_modules',
'c',
'package.json',
),
value: { ...mockSchema, title: 'c2' },
},
]);
await expect(collectConfigSchemas(['a'], [])).resolves.toEqual(
expect.arrayContaining([
{
path: path.join('node_modules', 'a', 'package.json'),
value: mockSchema,
},
{
path: path.join('node_modules', 'b', 'package.json'),
value: { ...mockSchema, title: 'b' },
},
{
path: path.join('node_modules', 'c', 'package.json'),
value: { ...mockSchema, title: 'c1' },
},
{
path: path.join(
'node_modules',
'b',
'node_modules',
'c',
'package.json',
),
value: { ...mockSchema, title: 'c2' },
},
]),
);
});
it('should not allow unknown schema file types', async () => {