Skip to content

Commit

Permalink
More testing needed
Browse files Browse the repository at this point in the history
  • Loading branch information
NullVoxPopuli committed Jul 15, 2023
1 parent 95345f9 commit 8f1e251
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion tests/smoke-tests/--typescript.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ for (let packageManager of SUPPORTED_PACKAGE_MANAGERS) {
let distDir = '';
let declarationsDir = '';
let typeTests = '';
let addonDir = '';

beforeAll(async () => {
tmpDir = await createTmp();
Expand All @@ -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');
Expand All @@ -37,14 +39,38 @@ 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 () => {
await runScript({ cwd, script: 'build', packageManager: 'pnpm' });

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',
Expand All @@ -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);

Expand Down

0 comments on commit 8f1e251

Please sign in to comment.