Skip to content

Commit

Permalink
fixup prepare unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
marcopiraccini committed Jan 8, 2024
1 parent dbd56b7 commit befa821
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions test/main/prepare-folder.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit befa821

Please sign in to comment.