Skip to content

Commit b3a38b3

Browse files
committed
test: setup basic e2e
1 parent c150de0 commit b3a38b3

File tree

3 files changed

+21
-7
lines changed

3 files changed

+21
-7
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import type { CoreConfig } from '@code-pushup/models';
2+
import {typescriptPlugin} from "@code-pushup/typescript-plugin";
3+
4+
export default {
5+
plugins: [
6+
await typescriptPlugin({
7+
tsConfigPath: 'tsconfig.json',
8+
}),
9+
],
10+
categories: [],
11+
} satisfies CoreConfig;

e2e/plugin-typescript-e2e/tests/collect.e2e.test.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@ describe('PLUGIN collect report with typescript-plugin NPM package', () => {
2626
await teardownTestFolder(testFileDir);
2727
});
2828

29+
it('should have current TS version defaults generated after install', async () => {
30+
await expect(readJsonFile(
31+
path.join(testFileDir, 'node_modules', '.code-pushup', 'plugin-typescript', 'default-ts-configs', await getCurrentTsVersion()),
32+
)).resolves.not.toThrow();
33+
});
34+
35+
2936
it('should run plugin over CLI and creates report.json', async () => {
3037
const {code, stdout} = await executeProcess({
3138
command: 'npx',
@@ -38,8 +45,5 @@ describe('PLUGIN collect report with typescript-plugin NPM package', () => {
3845
const cleanStdout = removeColorCodes(stdout);
3946
expect(cleanStdout).toContain('● NoImplicitAny');
4047

41-
await expect(readJsonFile(
42-
path.join('node_modules', '.code-pushup', 'plugin-typescript', 'default-ts-configs', await getCurrentTsVersion()),
43-
)).resolves.not.toThrow();
4448
});
4549
});
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
import type { Logger } from '@poppinss/cliui';
2-
3-
export function getLogMessages(logger: Logger): string[] {
1+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
2+
export function getLogMessages(logger: any): string[] {
43
return logger
54
.getRenderer()
65
.getLogs()
7-
.map(({ message }) => message);
6+
.map(({ message }: {message: string}) => message);
87
}

0 commit comments

Comments
 (0)