try to fix the flaky config collector test

Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2023-11-07 16:12:25 +01:00
parent 1f9525bd7a
commit cf59a34de6
@@ -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 () => {