Skip to content

Commit 25f4d73

Browse files
authored
refactor: Unify Karma tsconfigs (#3296)
This pull request updates TypeScript configuration files related to testing, mainly by centralizing the configuration of type definitions for Karma tests. The main change is moving the specification of test-related type definitions from individual package-level `tsconfig.karma.json` files into the root `tsconfig.karma.json`, simplifying and unifying the configuration across packages. ### Changes **Centralization and simplification of test type definitions:** * The root `tsconfig.karma.json` now includes all necessary test-related type definitions (`jest`, `jest-extended`, and `@streamr/test-utils/customMatcherTypes`) in its `types` array, ensuring consistent type support for tests across all packages. * The `display` field in the root `tsconfig.karma.json` was updated to use a hyphen instead of an en dash for consistency. **Cleanup of package-level configurations:** * Removed the `types` arrays from the `tsconfig.karma.json` files in `packages/dht`, `packages/proto-rpc`, `packages/trackerless-network`, and `packages/utils`, as these are now inherited from the root config. [[1]](diffhunk://#diff-ee756c159139fc121c7690550bbdedebbe93f791e29c68f80247e93b46a72287L4-R4) [[2]](diffhunk://#diff-07b674f7bfb21f19369939a17a7a6ae2623d3b6de78fc89e1214d07764ef38c5L4-R4) [[3]](diffhunk://#diff-5c2698258694c8934a41c50bf6374b3340732bfc80bd5eb9a407c89d8b46d0b7L4-R4) **Other minor updates:** * The root `tsconfig.karma.json` now only includes the latest ECMAScript and DOM libraries in its `lib` array, removing older versions for clarity and modernity[^1]. [^1]: `lib` field is cumulative – including `ESNext` (bleeding edge) means we implicitly include all previous.
1 parent 1b2eb13 commit 25f4d73

File tree

5 files changed

+10
-29
lines changed

5 files changed

+10
-29
lines changed

packages/dht/tsconfig.karma.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
{
22
"extends": "../../tsconfig.karma.json",
33
"compilerOptions": {
4-
"outDir": "dist",
5-
"types": [
6-
"jest",
7-
"jest-extended"
8-
]
4+
"outDir": "dist"
95
},
106
"include": [
117
"src",

packages/proto-rpc/tsconfig.karma.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
{
22
"extends": "../../tsconfig.karma.json",
33
"compilerOptions": {
4-
"outDir": "dist",
5-
"types": [
6-
"jest"
7-
]
4+
"outDir": "dist"
85
},
96
"include": [
107
"src"

packages/trackerless-network/tsconfig.karma.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
{
22
"extends": "../../tsconfig.karma.json",
33
"compilerOptions": {
4-
"outDir": "dist",
5-
"types": [
6-
"jest",
7-
"@streamr/test-utils/customMatcherTypes"
8-
]
4+
"outDir": "dist"
95
},
106
"include": [
117
"src",

packages/utils/tsconfig.karma.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
{
22
"extends": "../../tsconfig.karma.json",
33
"compilerOptions": {
4-
"outDir": "dist",
5-
"types": [
6-
"jest",
7-
"jest-extended"
8-
]
4+
"outDir": "dist"
95
},
106
"include": [
117
"src"

tsconfig.karma.json

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,12 @@
11
{
22
"$schema": "https://json.schemastore.org/tsconfig",
3-
"display": "Browser Streamr",
3+
"display": "Browser - Streamr",
44
"compilerOptions": {
55
"target": "ES2015",
66
"module": "commonjs",
77
"allowJs": true,
88
"declaration": true,
99
"lib": [
10-
"ES5",
11-
"ES2015",
12-
"ES2016",
13-
"ES2017",
14-
"ES2018",
15-
"ES2019",
16-
"ES2020",
17-
"ES2021",
1810
"ESNext",
1911
"DOM"
2012
],
@@ -23,7 +15,11 @@
2315
"resolveJsonModule": true,
2416
"moduleResolution": "node",
2517
"isolatedModules": true,
26-
"types": [],
18+
"types": [
19+
"jest",
20+
"jest-extended",
21+
"@streamr/test-utils/customMatcherTypes"
22+
],
2723
"sourceMap": true,
2824
"skipLibCheck": true,
2925
"forceConsistentCasingInFileNames": true,

0 commit comments

Comments
 (0)