From 8f1e25185a1aeea11984545a25d756bb97388386 Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Sat, 15 Jul 2023 18:21:13 -0400 Subject: [PATCH] More testing needed --- tests/smoke-tests/--typescript.test.ts | 30 +++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/tests/smoke-tests/--typescript.test.ts b/tests/smoke-tests/--typescript.test.ts index 49d6cacd..9a6c6273 100644 --- a/tests/smoke-tests/--typescript.test.ts +++ b/tests/smoke-tests/--typescript.test.ts @@ -19,6 +19,7 @@ for (let packageManager of SUPPORTED_PACKAGE_MANAGERS) { let distDir = ''; let declarationsDir = ''; let typeTests = ''; + let addonDir = ''; beforeAll(async () => { tmpDir = await createTmp(); @@ -29,6 +30,7 @@ for (let packageManager of SUPPORTED_PACKAGE_MANAGERS) { }); cwd = path.join(tmpDir, name); + addonDir = path.join(cwd, name); typeTests = path.join(cwd, name, 'type-tests'); distDir = path.join(cwd, name, 'dist'); declarationsDir = path.join(cwd, name, 'declarations'); @@ -37,7 +39,7 @@ for (let packageManager of SUPPORTED_PACKAGE_MANAGERS) { }); afterAll(async () => { - await fs.rm(tmpDir, { recursive: true, force: true }); + // await fs.rm(tmpDir, { recursive: true, force: true }); }); it('was generated correctly', async () => { @@ -45,6 +47,30 @@ for (let packageManager of SUPPORTED_PACKAGE_MANAGERS) { await assertGeneratedCorrectly({ projectRoot: cwd }); + let addonContents = await dirContents(addonDir); + + expect(addonContents).to.deep.equal([ + '.eslintignore', + '.eslintrc.cjs', + '.gitignore', + '.prettierignore', + '.prettierrc.js', + '.template-lintrc.cjs', + 'LICENSE.md', + 'README.md', + 'addon-main.cjs', + 'babel.config.json', + 'declarations', + 'dist', + 'node_modules', + 'package.json', + 'rollup.config.mjs', + 'src', + 'tsconfig.json', + 'type-tests', + 'unpublished-development-types', + ]); + await matchesFixture(path.join(typeTests, 'index.test.ts'), { cwd, scenario: 'addon-only-ts', @@ -57,6 +83,8 @@ for (let packageManager of SUPPORTED_PACKAGE_MANAGERS) { expect(exitCode).toEqual(0); + console.log({ distDir, declarationsDir }); + let distContents = await dirContents(distDir); let declarationsContents = await dirContents(declarationsDir);