Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: add type script plugin e2e #974

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
test(plugin-typescript): adjust e2e test
  • Loading branch information
BioPhoton committed Mar 21, 2025
commit 97358eb6f4576772184b29a047ed5e4a582bd24c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
"details": {
"issues": [
{
"message": "TS1136: Property assignment expected.",
"severity": "error",
"source": {
"file": "tmp/e2e/plugin-typescript-e2e/src/1-syntax-errors.ts",
Expand All @@ -56,7 +55,6 @@
"details": {
"issues": [
{
"message": "TS2683: 'this' implicitly has type 'any' because it does not have a type annotation.",
"severity": "error",
"source": {
"file": "tmp/e2e/plugin-typescript-e2e/src/2-semantic-errors.ts",
Expand All @@ -66,7 +64,6 @@
},
},
{
"message": "TS2322: Type 'null' is not assignable to type 'string'.",
"severity": "error",
"source": {
"file": "tmp/e2e/plugin-typescript-e2e/src/2-semantic-errors.ts",
Expand All @@ -88,7 +85,6 @@
"details": {
"issues": [
{
"message": "TS4112: This member cannot have an 'override' modifier because its containing class 'Standalone' does not extend another class.",
"severity": "error",
"source": {
"file": "tmp/e2e/plugin-typescript-e2e/src/4-languale-service.ts",
Expand Down Expand Up @@ -121,7 +117,6 @@
"details": {
"issues": [
{
"message": "TS6059: File '/Users/michael_hladky/WebstormProjects/quality-metrics-cli/tmp/e2e/plugin-typescript-e2e/exclude/utils.ts' is not under 'rootDir' 'src'. 'rootDir' is expected to contain all source files.",
"severity": "error",
"source": {
"file": "tmp/e2e/plugin-typescript-e2e/src/6-configuration-errors.ts",
Expand Down Expand Up @@ -161,10 +156,10 @@
"value": 0,
},
],
"date": "2025-03-21T14:28:54.857Z",
"date": "2025-03-21T15:11:20.928Z",
"description": "Official Code PushUp Typescript plugin.",
"docsUrl": "https://www.npmjs.com/package/@code-pushup/typescript-plugin/",
"duration": 2251,
"duration": 2173,
"groups": [
{
"description": "Syntax, semantic, and internal compiler errors are critical for identifying and preventing bugs.",
Expand Down
20 changes: 11 additions & 9 deletions e2e/plugin-typescript-e2e/tests/collect.e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,17 @@ describe('PLUGIN collect report with typescript-plugin NPM package', () => {
...audit,
details: {
...audit.details,
issues: (audit?.details?.issues ?? []).map(issue => ({
...issue,
source: {
...issue.source,
...(issue?.source?.file
? { file: osAgnosticPath(issue?.source?.file) }
: {}),
},
})),
issues: (audit?.details?.issues ?? []).map(
({ message, ...issue }) => ({
...issue,
source: {
...issue.source,
...(issue?.source?.file
? { file: osAgnosticPath(issue?.source?.file) }
: {}),
},
}),
),
},
})),
})),
Expand Down
Loading