Skip to content

Commit d2f874b

Browse files
committed
test: Move nyc config to file
Using a configuration file allows for a better reuse of common settings across multiple packages. Coverage thresholds have been increased for several packages to ensure a high code quality.
1 parent 3193dd8 commit d2f874b

11 files changed

Lines changed: 93 additions & 148 deletions

File tree

nyc.common.config.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
export default {
2+
"reporter": [
3+
"lcov",
4+
"text",
5+
"text-summary"
6+
],
7+
"exclude": [
8+
"coverage/**",
9+
"test/**",
10+
"*.config.js"
11+
],
12+
"check-coverage": true,
13+
"watermarks": {
14+
"statements": [
15+
70,
16+
90
17+
],
18+
"branches": [
19+
70,
20+
90
21+
],
22+
"functions": [
23+
70,
24+
90
25+
],
26+
"lines": [
27+
70,
28+
90
29+
]
30+
},
31+
"cache": true,
32+
"all": true
33+
};

packages/builder/nyc.config.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import nycCommonConfig from "../../nyc.common.config.js";
2+
3+
// Exclude jsdoc library files from coverage as they are originally maintained at https://github.com/UI5/openui5/tree/master/lib/jsdoc
4+
nycCommonConfig.exclude.push("lib/processors/jsdoc/lib/**");
5+
6+
export default {
7+
...nycCommonConfig,
8+
"statements": 95,
9+
"branches": 90,
10+
"functions": 95,
11+
"lines": 95,
12+
};

packages/cli/nyc.config.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import nycCommonConfig from "../../nyc.common.config.js";
2+
3+
export default {
4+
...nycCommonConfig,
5+
"statements": 95,
6+
"branches": 90,
7+
"functions": 85,
8+
"lines": 95,
9+
};

packages/cli/package.json

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -50,43 +50,6 @@
5050
"lib/**",
5151
"LICENSES/**"
5252
],
53-
"nyc": {
54-
"reporter": [
55-
"lcov",
56-
"text",
57-
"text-summary"
58-
],
59-
"exclude": [
60-
"docs/**",
61-
"coverage/**",
62-
"test/**"
63-
],
64-
"check-coverage": true,
65-
"statements": 80,
66-
"branches": 75,
67-
"functions": 75,
68-
"lines": 80,
69-
"watermarks": {
70-
"statements": [
71-
70,
72-
90
73-
],
74-
"branches": [
75-
70,
76-
90
77-
],
78-
"functions": [
79-
70,
80-
90
81-
],
82-
"lines": [
83-
70,
84-
90
85-
]
86-
},
87-
"cache": true,
88-
"all": true
89-
},
9053
"repository": {
9154
"type": "git",
9255
"url": "git+ssh://git@github.com/UI5/cli.git",

packages/fs/nyc.config.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import nycCommonConfig from "../../nyc.common.config.js";
2+
3+
export default {
4+
...nycCommonConfig,
5+
"statements": 90,
6+
"branches": 85,
7+
"functions": 90,
8+
"lines": 90,
9+
};

packages/fs/package.json

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -54,43 +54,6 @@
5454
"lib/**",
5555
"LICENSES/**"
5656
],
57-
"nyc": {
58-
"reporter": [
59-
"lcov",
60-
"text",
61-
"text-summary"
62-
],
63-
"exclude": [
64-
"docs/**",
65-
"coverage/**",
66-
"test/**"
67-
],
68-
"check-coverage": true,
69-
"statements": 85,
70-
"branches": 80,
71-
"functions": 90,
72-
"lines": 85,
73-
"watermarks": {
74-
"statements": [
75-
70,
76-
90
77-
],
78-
"branches": [
79-
70,
80-
90
81-
],
82-
"functions": [
83-
70,
84-
90
85-
],
86-
"lines": [
87-
70,
88-
90
89-
]
90-
},
91-
"cache": true,
92-
"all": true
93-
},
9457
"repository": {
9558
"type": "git",
9659
"url": "git+ssh://git@github.com/UI5/cli.git",

packages/logger/nyc.config.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import nycCommonConfig from "../../nyc.common.config.js";
2+
3+
export default {
4+
...nycCommonConfig,
5+
"statements": 100,
6+
"branches": 100,
7+
"functions": 100,
8+
"lines": 100,
9+
};

packages/logger/package.json

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -47,43 +47,6 @@
4747
"lib/**",
4848
"LICENSES/**"
4949
],
50-
"nyc": {
51-
"reporter": [
52-
"lcov",
53-
"text",
54-
"text-summary"
55-
],
56-
"exclude": [
57-
"docs/**",
58-
"coverage/**",
59-
"test/**"
60-
],
61-
"check-coverage": true,
62-
"statements": 90,
63-
"branches": 90,
64-
"functions": 90,
65-
"lines": 90,
66-
"watermarks": {
67-
"statements": [
68-
70,
69-
90
70-
],
71-
"branches": [
72-
70,
73-
90
74-
],
75-
"functions": [
76-
70,
77-
90
78-
],
79-
"lines": [
80-
70,
81-
90
82-
]
83-
},
84-
"cache": true,
85-
"all": true
86-
},
8750
"repository": {
8851
"type": "git",
8952
"url": "git+ssh://git@github.com/UI5/cli.git",

packages/project/nyc.config.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import nycCommonConfig from "../../nyc.common.config.js";
2+
3+
export default {
4+
...nycCommonConfig,
5+
"statements": 95,
6+
"branches": 90,
7+
"functions": 95,
8+
"lines": 95,
9+
};

packages/project/package.json

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -55,43 +55,6 @@
5555
"lib/**",
5656
"LICENSES/**"
5757
],
58-
"nyc": {
59-
"reporter": [
60-
"lcov",
61-
"text",
62-
"text-summary"
63-
],
64-
"exclude": [
65-
"docs/**",
66-
"coverage/**",
67-
"test/**"
68-
],
69-
"check-coverage": true,
70-
"statements": 90,
71-
"branches": 85,
72-
"functions": 90,
73-
"lines": 90,
74-
"watermarks": {
75-
"statements": [
76-
70,
77-
90
78-
],
79-
"branches": [
80-
70,
81-
90
82-
],
83-
"functions": [
84-
70,
85-
90
86-
],
87-
"lines": [
88-
70,
89-
90
90-
]
91-
},
92-
"cache": true,
93-
"all": true
94-
},
9558
"repository": {
9659
"type": "git",
9760
"url": "git+ssh://git@github.com/UI5/cli.git",

0 commit comments

Comments
 (0)