Skip to content

Commit 20267fd

Browse files
committed
feat(plugin-jsdocs): replace issues with tree
1 parent 2dc1689 commit 20267fd

File tree

15 files changed

+912
-670
lines changed

15 files changed

+912
-670
lines changed

e2e/plugin-jsdocs-e2e/tests/__snapshots__/collect.e2e.test.ts.snap

Lines changed: 410 additions & 42 deletions
Large diffs are not rendered by default.

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import { cp } from 'node:fs/promises';
22
import path from 'node:path';
3+
import { simpleGit } from 'simple-git';
34
import { afterAll, afterEach, beforeAll, describe, expect, it } from 'vitest';
45
import { type Report, reportSchema } from '@code-pushup/models';
56
import { nxTargetProject } from '@code-pushup/test-nx-utils';
67
import {
78
E2E_ENVIRONMENTS_DIR,
89
TEST_OUTPUT_DIR,
10+
initGitRepo,
911
omitVariableReportData,
1012
teardownTestFolder,
1113
} from '@code-pushup/test-utils';
@@ -34,6 +36,8 @@ describe('PLUGIN collect report with jsdocs-plugin NPM package', () => {
3436
beforeAll(async () => {
3537
await cp(fixturesAngularDir, angularDir, { recursive: true });
3638
await cp(fixturesReactDir, reactDir, { recursive: true });
39+
await initGitRepo(simpleGit, { baseDir: angularDir });
40+
await initGitRepo(simpleGit, { baseDir: reactDir });
3741
});
3842

3943
afterAll(async () => {
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/**
2+
* An example function which returns a mock value.
3+
* @returns A mock value
4+
*/
5+
export function exampleFunction() {
6+
return 'exampleFunction';
7+
}

packages/plugin-jsdocs/project.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
"outputPath": "dist/packages/plugin-jsdocs",
1313
"main": "packages/plugin-jsdocs/src/index.ts",
1414
"tsConfig": "packages/plugin-jsdocs/tsconfig.lib.json",
15-
"additionalEntryPoints": ["packages/plugin-jsdocs/src/bin.ts"],
1615
"assets": ["packages/plugin-jsdocs/*.md"]
1716
}
1817
},

packages/plugin-jsdocs/src/lib/runner/__snapshots__/doc-processor.unit.test.ts.snap

Lines changed: 103 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -2,91 +2,108 @@
22

33
exports[`getDocumentationReport > should produce a full report 1`] = `
44
{
5-
"classes": {
6-
"coverage": 33.33,
7-
"issues": [
8-
{
9-
"file": "test.ts",
10-
"line": 4,
11-
"name": "test",
12-
"type": "classes",
13-
},
14-
{
15-
"file": "test.ts",
16-
"line": 5,
17-
"name": "test",
18-
"type": "classes",
19-
},
20-
],
21-
"nodesCount": 3,
22-
},
23-
"enums": {
24-
"coverage": 33.33,
25-
"issues": [
26-
{
27-
"file": "test.ts",
28-
"line": 8,
29-
"name": "test",
30-
"type": "enums",
31-
},
32-
{
33-
"file": "test.ts",
34-
"line": 9,
35-
"name": "test",
36-
"type": "enums",
37-
},
38-
],
39-
"nodesCount": 3,
40-
},
41-
"functions": {
42-
"coverage": 100,
43-
"issues": [],
44-
"nodesCount": 3,
45-
},
46-
"interfaces": {
47-
"coverage": 66.67,
48-
"issues": [
49-
{
50-
"file": "test.ts",
51-
"line": 15,
52-
"name": "test",
53-
"type": "interfaces",
54-
},
55-
],
56-
"nodesCount": 3,
57-
},
58-
"methods": {
59-
"coverage": 100,
60-
"issues": [],
61-
"nodesCount": 0,
62-
},
63-
"properties": {
64-
"coverage": 100,
65-
"issues": [],
66-
"nodesCount": 0,
67-
},
68-
"types": {
69-
"coverage": 50,
70-
"issues": [
71-
{
72-
"file": "test.ts",
73-
"line": 10,
74-
"name": "test",
75-
"type": "types",
76-
},
77-
{
78-
"file": "test.ts",
79-
"line": 11,
80-
"name": "test",
81-
"type": "types",
82-
},
83-
],
84-
"nodesCount": 4,
85-
},
86-
"variables": {
87-
"coverage": 100,
88-
"issues": [],
89-
"nodesCount": 0,
90-
},
5+
"classes": [
6+
{
7+
"covered": 1,
8+
"missing": [
9+
{
10+
"kind": "class",
11+
"name": "test",
12+
"startLine": 4,
13+
},
14+
{
15+
"kind": "class",
16+
"name": "test",
17+
"startLine": 5,
18+
},
19+
],
20+
"path": "test.ts",
21+
"total": 3,
22+
},
23+
],
24+
"enums": [
25+
{
26+
"covered": 1,
27+
"missing": [
28+
{
29+
"kind": "enum",
30+
"name": "test",
31+
"startLine": 8,
32+
},
33+
{
34+
"kind": "enum",
35+
"name": "test",
36+
"startLine": 9,
37+
},
38+
],
39+
"path": "test.ts",
40+
"total": 3,
41+
},
42+
],
43+
"functions": [
44+
{
45+
"covered": 3,
46+
"missing": [],
47+
"path": "test.ts",
48+
"total": 3,
49+
},
50+
],
51+
"interfaces": [
52+
{
53+
"covered": 2,
54+
"missing": [
55+
{
56+
"kind": "interface",
57+
"name": "test",
58+
"startLine": 15,
59+
},
60+
],
61+
"path": "test.ts",
62+
"total": 3,
63+
},
64+
],
65+
"methods": [
66+
{
67+
"covered": 0,
68+
"missing": [],
69+
"path": "test.ts",
70+
"total": 0,
71+
},
72+
],
73+
"properties": [
74+
{
75+
"covered": 0,
76+
"missing": [],
77+
"path": "test.ts",
78+
"total": 0,
79+
},
80+
],
81+
"types": [
82+
{
83+
"covered": 2,
84+
"missing": [
85+
{
86+
"kind": "type",
87+
"name": "test",
88+
"startLine": 10,
89+
},
90+
{
91+
"kind": "type",
92+
"name": "test",
93+
"startLine": 11,
94+
},
95+
],
96+
"path": "test.ts",
97+
"total": 4,
98+
},
99+
],
100+
"variables": [
101+
{
102+
"covered": 0,
103+
"missing": [],
104+
"path": "test.ts",
105+
"total": 0,
106+
},
107+
],
91108
}
92109
`;

0 commit comments

Comments
 (0)