Skip to content

Commit 9c64360

Browse files
committed
Update Typescript.
This CR updates Typescript to version 4.0.3, @types/node to version 14.11.8, ts-node to version 9.0.0 Also, because of changes in Typescript 3.9.0 (microsoft/TypeScript#32264) the testing becoming failing. The testing (sinon) library uses for stubbing dependencies the enumerable properties of objects. We do not able to use that way if we need to stub some dependency in tests with Typescript 3.9+ versions. The right way is about refactoring code (adding dependency injection, for example), but it's a huge task. Fo resolving that problem, we use the 'tslib 1.13.0' helper module and compile for testing the code with included helpers from that lib. It's at least a working solution until a better way is found. Resolves: OLPEDGE-2315 Signed-off-by: Oleksii Zubko <[email protected]>
1 parent d2715a0 commit 9c64360

File tree

14 files changed

+454
-358
lines changed

14 files changed

+454
-358
lines changed

@here/olp-sdk-authentication/package.json

+5-4
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
"scripts": {
1414
"build": "tsc",
1515
"lint": "tslint -c tslint.json -p tsconfig.json",
16-
"test": "mocha",
17-
"coverage": "nyc mocha",
16+
"test": "tsc -p ./test/tsconfig.json && mocha",
17+
"coverage": "nyc npm run test",
1818
"codecov": "npm run coverage && nyc report --reporter=lcov",
1919
"prepare": "tsc --sourceMap false && npm run bundle",
2020
"bundle": "npm run bundle:dev && npm run bundle:prod",
@@ -58,7 +58,7 @@
5858
"@types/chai": "^4.2.7",
5959
"@types/fetch-mock": "^7.3.2",
6060
"@types/mocha": "^5.2.7",
61-
"@types/node": "^13.1.2",
61+
"@types/node": "^14.11.8",
6262
"@types/sinon-chai": "^3.2.3",
6363
"@types/sinon": "7.0.3",
6464
"awesome-typescript-loader": "^5.2.1",
@@ -76,7 +76,8 @@
7676
"tslint": "^5.20.1",
7777
"tslint-config-prettier": "^1.18.0",
7878
"typedoc": "^0.15.6",
79-
"typescript": "3.5.3",
79+
"typescript": "4.0.3",
80+
"tslib": "1.13.0",
8081
"webpack": "^4.41.5",
8182
"webpack-cli": "^3.3.10"
8283
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
"importHelpers": true
5+
}
6+
}

@here/olp-sdk-core/package.json

+5-4
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
"scripts": {
1313
"build": "tsc",
1414
"lint": "tslint -c tslint.json -p tsconfig.json",
15-
"test": "mocha",
16-
"coverage": "nyc mocha",
15+
"test": "tsc -p ./test/tsconfig.json && mocha",
16+
"coverage": "nyc npm run test",
1717
"codecov": "npm run coverage && nyc report --reporter=lcov",
1818
"prepare": "tsc --sourceMap false && npm run bundle",
1919
"bundle": "npm run bundle:dev && npm run bundle:prod",
@@ -55,7 +55,7 @@
5555
"devDependencies": {
5656
"@types/chai": "^4.2.7",
5757
"@types/mocha": "^5.2.7",
58-
"@types/node": "^13.1.2",
58+
"@types/node": "^14.11.8",
5959
"@types/sinon": "7.0.3",
6060
"@types/sinon-chai": "^3.2.3",
6161
"awesome-typescript-loader": "^5.2.1",
@@ -73,7 +73,8 @@
7373
"tslint": "^5.20.1",
7474
"tslint-config-prettier": "^1.18.0",
7575
"typedoc": "^0.15.0",
76-
"typescript": "3.5.3",
76+
"typescript": "4.0.3",
77+
"tslib": "1.13.0",
7778
"webpack": "^4.41.5",
7879
"webpack-cli": "^3.3.10"
7980
}

@here/olp-sdk-core/test/tsconfig.json

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
"importHelpers": true
5+
}
6+
}

@here/olp-sdk-dataservice-api/package.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
"scripts": {
1212
"build": "tsc",
1313
"lint": "tslint -c tslint.json -p tsconfig.json",
14-
"test": "mocha",
15-
"coverage": "nyc mocha",
14+
"test": "tsc -p ./test/tsconfig.json && mocha",
15+
"coverage": "nyc npm run test",
1616
"codecov": "npm run coverage && nyc report --reporter=lcov",
1717
"prepare": "tsc --sourceMap false && npm run bundle",
1818
"bundle": "npm run bundle:dev && npm run bundle:prod",
@@ -66,7 +66,8 @@
6666
"source-map-support": "^0.5.16",
6767
"tslint": "^5.20.1",
6868
"tslint-config-prettier": "^1.18.0",
69-
"typescript": "3.5.3",
69+
"typescript": "4.0.3",
70+
"tslib": "1.13.0",
7071
"webpack": "^4.41.5",
7172
"webpack-cli": "^3.3.10",
7273
"typedoc": "^0.15.6"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
"importHelpers": true
5+
}
6+
}

@here/olp-sdk-dataservice-read/package.json

+5-4
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
"scripts": {
1313
"build": "tsc",
1414
"lint": "tslint -c tslint.json -p tsconfig.json",
15-
"test": "mocha",
16-
"coverage": "nyc mocha",
15+
"test": "tsc -p ./test/tsconfig.json && mocha",
16+
"coverage": "nyc npm run test",
1717
"codecov": "npm run coverage && nyc report --reporter=lcov",
1818
"prepare": "tsc --sourceMap false && npm run bundle",
1919
"bundle": "npm run bundle:dev && npm run bundle:prod",
@@ -56,7 +56,7 @@
5656
"devDependencies": {
5757
"@types/chai": "^4.2.7",
5858
"@types/mocha": "^5.2.7",
59-
"@types/node": "^13.1.2",
59+
"@types/node": "^14.11.8",
6060
"@types/sinon": "7.0.3",
6161
"@types/sinon-chai": "^3.2.3",
6262
"awesome-typescript-loader": "^5.2.1",
@@ -74,7 +74,8 @@
7474
"tslint": "^5.20.1",
7575
"tslint-config-prettier": "^1.18.0",
7676
"typedoc": "^0.15.0",
77-
"typescript": "3.5.3",
77+
"typescript": "4.0.3",
78+
"tslib": "1.13.0",
7879
"webpack": "^4.41.5",
7980
"webpack-cli": "^3.3.10"
8081
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
"importHelpers": true
5+
}
6+
}

@here/olp-sdk-dataservice-write/package.json

+5-4
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
"scripts": {
1313
"build": "tsc",
1414
"lint": "tslint -c tslint.json -p tsconfig.json",
15-
"test": "mocha",
16-
"coverage": "nyc mocha",
15+
"test": "tsc -p ./test/tsconfig.json && mocha",
16+
"coverage": "nyc npm run test",
1717
"codecov": "npm run coverage && nyc report --reporter=lcov",
1818
"prepare": "tsc --sourceMap false && npm run bundle",
1919
"webpack": "webpack",
@@ -57,7 +57,7 @@
5757
"devDependencies": {
5858
"@types/chai": "^4.2.7",
5959
"@types/mocha": "^5.2.7",
60-
"@types/node": "^13.1.2",
60+
"@types/node": "^14.11.8",
6161
"@types/sinon": "7.0.3",
6262
"@types/sinon-chai": "^3.2.3",
6363
"awesome-typescript-loader": "^5.2.1",
@@ -75,7 +75,8 @@
7575
"tslint": "^5.20.1",
7676
"tslint-config-prettier": "^1.18.0",
7777
"typedoc": "^0.15.0",
78-
"typescript": "3.5.3",
78+
"typescript": "4.0.3",
79+
"tslib": "1.13.0",
7980
"webpack": "^4.41.5",
8081
"webpack-cli": "^3.3.10"
8182
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
"importHelpers": true
5+
}
6+
}

@here/olp-sdk-fetch/package.json

+5-4
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
"scripts": {
1212
"build": "tsc",
1313
"lint": "tslint -c tslint.json -p tsconfig.json",
14-
"test": "mocha",
15-
"coverage": "nyc mocha",
14+
"test": "tsc -p ./test/tsconfig.json && mocha",
15+
"coverage": "nyc npm run test",
1616
"codecov": "npm run coverage && nyc report --reporter=lcov",
1717
"prepare": "tsc --sourceMap false && npm run bundle",
1818
"bundle": "npm run bundle:dev && npm run bundle:prod",
@@ -53,7 +53,7 @@
5353
"devDependencies": {
5454
"@types/chai": "^4.2.7",
5555
"@types/mocha": "^5.2.7",
56-
"@types/node": "^13.1.2",
56+
"@types/node": "^14.11.8",
5757
"@types/sinon": "7.0.3",
5858
"@types/sinon-chai": "^3.2.3",
5959
"awesome-typescript-loader": "^5.2.1",
@@ -71,7 +71,8 @@
7171
"tslint": "^5.20.1",
7272
"tslint-config-prettier": "^1.18.0",
7373
"typedoc": "^0.15.0",
74-
"typescript": "3.5.3",
74+
"typescript": "4.0.3",
75+
"tslib": "1.13.0",
7576
"webpack": "^4.41.5",
7677
"webpack-cli": "^3.3.10",
7778
"zlib": "^1.0.5"
+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
"importHelpers": true
5+
}
6+
}

package.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,14 @@
5959
"typedoc": "npx typedoc --disableOutputCheck --options typedoc.json"
6060
},
6161
"devDependencies": {
62-
"@types/node": "^13.1.2",
62+
"@types/node": "^14.11.8",
6363
"lerna": "^3.20.2",
64-
"typescript": "3.5.3",
64+
"typescript": "4.0.3",
65+
"tslib": "1.13.0",
6566
"codecov": "3.7.2",
6667
"mockserver-node": "5.9.0",
6768
"mockserver-client": "5.9.0",
68-
"ts-node": "8.6.2",
69+
"ts-node": "9.0.0",
6970
"puppeteer": "^2.1.1",
7071
"puppeteer-to-istanbul": "^1.2.2",
7172
"nyc": "^15.0.0",

0 commit comments

Comments
 (0)