From cf59a34de62b9ee230093e61ac0e39e5609264f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Tue, 7 Nov 2023 16:12:25 +0100 Subject: [PATCH] try to fix the flaky config collector test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- .../config-loader/src/schema/collect.test.ts | 50 ++++++++++--------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/packages/config-loader/src/schema/collect.test.ts b/packages/config-loader/src/schema/collect.test.ts index f513253619..2323b8d808 100644 --- a/packages/config-loader/src/schema/collect.test.ts +++ b/packages/config-loader/src/schema/collect.test.ts @@ -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 () => {