From befa8219551df10fa3dfc1b91ccb1725b1362ccf Mon Sep 17 00:00:00 2001 From: marcopiraccini Date: Mon, 8 Jan 2024 12:32:16 +0100 Subject: [PATCH] fixup prepare unit tests --- test/main/prepare-folder.test.mjs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/test/main/prepare-folder.test.mjs b/test/main/prepare-folder.test.mjs index 29ee0f28..7f264789 100644 --- a/test/main/prepare-folder.test.mjs +++ b/test/main/prepare-folder.test.mjs @@ -55,15 +55,21 @@ test('Install one @platformatic/service template', async () => { const appDir = await mkdtemp(join(tmpdir(), 'plat-app-test-create')) await prepareFolder(appDir, ['@platformatic/service'], logger, 'test-app') expect(logger.infos.at(-1)[0].name).toEqual('@platformatic/service') - expect(logger.errors.length).toBe(0) + // We need to skip the npm warnings + const errors = logger.errors.map((e) => e[0]).filter((e) => e.includes('npm ERR!')) + expect(errors.length).toBe(0) }, 30000) test('Install one @platformatic/service template twice', async () => { const appDir = await mkdtemp(join(tmpdir(), 'plat-app-test-create')) await prepareFolder(appDir, ['@platformatic/service'], logger, 'test-app') expect(logger.infos.at(-1)[0].name).toEqual('@platformatic/service') - expect(logger.errors.length).toBe(0) + // We need to skip the npm warnings + const errors = logger.errors.map((e) => e[0]).filter((e) => e.includes('npm ERR!')) + expect(errors.length).toBe(0) await prepareFolder(appDir, ['@platformatic/service'], logger, 'test-app') - expect(logger.errors.length).toBe(0) + // We need to skip the npm warnings + const errors2 = logger.errors.map((e) => e[0]).filter((e) => e.includes('npm ERR!')) + expect(errors2.length).toBe(0) }, 30000)