Skip to content

Commit e61be13

Browse files
committed
test(plugin-typescript-e2e): wip
1 parent 7a69506 commit e61be13

File tree

15 files changed

+368
-37
lines changed

15 files changed

+368
-37
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import type { CoreConfig } from '@code-pushup/models';
2+
import {
3+
getCategoryRefsFromGroups,
4+
typescriptPlugin,
5+
} from '@code-pushup/typescript-plugin';
6+
7+
export default {
8+
plugins: [
9+
await typescriptPlugin({
10+
tsConfigPath: 'tsconfig.json',
11+
}),
12+
],
13+
categories: [
14+
{
15+
slug: 'typescript-quality',
16+
title: 'Typescript',
17+
refs: await getCategoryRefsFromGroups({
18+
tsConfigPath: 'tsconfig.json',
19+
}),
20+
},
21+
],
22+
} satisfies CoreConfig;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export function test() {
2+
return 'test';
3+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
const a = { ; // Error: TS1136: Property assignment expected
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// 2683 - NoImplicitThis: 'this' implicitly has type 'any'.
2+
function noImplicitThisTS2683() {
3+
console.log(this.value); // Error 2683
4+
}
5+
6+
// 2531 - StrictNullChecks: Object is possibly 'null'.
7+
const strictNullChecksTS2531: string = null;
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
class Standalone {
2+
override method() { // Error: TS4114 - 'override' modifier can only be used in a class derived from a base class.
3+
console.log("Standalone method");
4+
}
5+
}
6+
const s = Standalone;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { test } from '../exclude/utils';
2+
3+
// TS6059:: File 'exclude/utils.ts' is not under 'rootDir' '.../configuration-errors'. 'rootDir' is expected to contain all source files.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"compilerOptions": {
3+
"rootDir": "./src",
4+
"target": "ES6",
5+
"module": "CommonJS",
6+
"strict": true,
7+
"verbatimModuleSyntax": false
8+
},
9+
"include": ["src/**/*.ts"]
10+
}

e2e/plugin-typescript-e2e/mocks/fixtures/minimal-setup/code-pushup.config.ts

Lines changed: 0 additions & 5 deletions
This file was deleted.

e2e/plugin-typescript-e2e/mocks/fixtures/minimal-setup/src/app.component.ts

Lines changed: 0 additions & 18 deletions
This file was deleted.

e2e/plugin-typescript-e2e/mocks/fixtures/minimal-setup/src/map-event.function.ts

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)