Skip to content

Commit

Permalink
Update Typescript.
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
OleksiiZubko committed Oct 11, 2020
1 parent d2715a0 commit c4c6134
Show file tree
Hide file tree
Showing 14 changed files with 454 additions and 358 deletions.
9 changes: 5 additions & 4 deletions @here/olp-sdk-authentication/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"scripts": {
"build": "tsc",
"lint": "tslint -c tslint.json -p tsconfig.json",
"test": "mocha",
"coverage": "nyc mocha",
"test": "tsc -p ./test/tsconfig.json && mocha",
"coverage": "nyc npm run test",
"codecov": "npm run coverage && nyc report --reporter=lcov",
"prepare": "tsc --sourceMap false && npm run bundle",
"bundle": "npm run bundle:dev && npm run bundle:prod",
Expand Down Expand Up @@ -58,7 +58,7 @@
"@types/chai": "^4.2.7",
"@types/fetch-mock": "^7.3.2",
"@types/mocha": "^5.2.7",
"@types/node": "^13.1.2",
"@types/node": "^14.11.8",
"@types/sinon-chai": "^3.2.3",
"@types/sinon": "7.0.3",
"awesome-typescript-loader": "^5.2.1",
Expand All @@ -76,7 +76,8 @@
"tslint": "^5.20.1",
"tslint-config-prettier": "^1.18.0",
"typedoc": "^0.15.6",
"typescript": "3.5.3",
"typescript": "4.0.3",
"tslib": "1.13.0",
"webpack": "^4.41.5",
"webpack-cli": "^3.3.10"
}
Expand Down
6 changes: 6 additions & 0 deletions @here/olp-sdk-authentication/test/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"importHelpers": true
}
}
9 changes: 5 additions & 4 deletions @here/olp-sdk-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"scripts": {
"build": "tsc",
"lint": "tslint -c tslint.json -p tsconfig.json",
"test": "mocha",
"coverage": "nyc mocha",
"test": "tsc -p ./test/tsconfig.json && mocha",
"coverage": "nyc npm run test",
"codecov": "npm run coverage && nyc report --reporter=lcov",
"prepare": "tsc --sourceMap false && npm run bundle",
"bundle": "npm run bundle:dev && npm run bundle:prod",
Expand Down Expand Up @@ -55,7 +55,7 @@
"devDependencies": {
"@types/chai": "^4.2.7",
"@types/mocha": "^5.2.7",
"@types/node": "^13.1.2",
"@types/node": "^14.11.8",
"@types/sinon": "7.0.3",
"@types/sinon-chai": "^3.2.3",
"awesome-typescript-loader": "^5.2.1",
Expand All @@ -73,7 +73,8 @@
"tslint": "^5.20.1",
"tslint-config-prettier": "^1.18.0",
"typedoc": "^0.15.0",
"typescript": "3.5.3",
"typescript": "4.0.3",
"tslib": "1.13.0",
"webpack": "^4.41.5",
"webpack-cli": "^3.3.10"
}
Expand Down
6 changes: 6 additions & 0 deletions @here/olp-sdk-core/test/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"importHelpers": true
}
}
7 changes: 4 additions & 3 deletions @here/olp-sdk-dataservice-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"scripts": {
"build": "tsc",
"lint": "tslint -c tslint.json -p tsconfig.json",
"test": "mocha",
"coverage": "nyc mocha",
"test": "tsc -p ./test/tsconfig.json && mocha",
"coverage": "nyc npm run test",
"codecov": "npm run coverage && nyc report --reporter=lcov",
"prepare": "tsc --sourceMap false && npm run bundle",
"bundle": "npm run bundle:dev && npm run bundle:prod",
Expand Down Expand Up @@ -66,7 +66,8 @@
"source-map-support": "^0.5.16",
"tslint": "^5.20.1",
"tslint-config-prettier": "^1.18.0",
"typescript": "3.5.3",
"typescript": "4.0.3",
"tslib": "1.13.0",
"webpack": "^4.41.5",
"webpack-cli": "^3.3.10",
"typedoc": "^0.15.6"
Expand Down
6 changes: 6 additions & 0 deletions @here/olp-sdk-dataservice-api/test/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"importHelpers": true
}
}
9 changes: 5 additions & 4 deletions @here/olp-sdk-dataservice-read/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"scripts": {
"build": "tsc",
"lint": "tslint -c tslint.json -p tsconfig.json",
"test": "mocha",
"coverage": "nyc mocha",
"test": "tsc -p ./test/tsconfig.json && mocha",
"coverage": "nyc npm run test",
"codecov": "npm run coverage && nyc report --reporter=lcov",
"prepare": "tsc --sourceMap false && npm run bundle",
"bundle": "npm run bundle:dev && npm run bundle:prod",
Expand Down Expand Up @@ -56,7 +56,7 @@
"devDependencies": {
"@types/chai": "^4.2.7",
"@types/mocha": "^5.2.7",
"@types/node": "^13.1.2",
"@types/node": "^14.11.8",
"@types/sinon": "7.0.3",
"@types/sinon-chai": "^3.2.3",
"awesome-typescript-loader": "^5.2.1",
Expand All @@ -74,7 +74,8 @@
"tslint": "^5.20.1",
"tslint-config-prettier": "^1.18.0",
"typedoc": "^0.15.0",
"typescript": "3.5.3",
"typescript": "4.0.3",
"tslib": "1.13.0",
"webpack": "^4.41.5",
"webpack-cli": "^3.3.10"
}
Expand Down
6 changes: 6 additions & 0 deletions @here/olp-sdk-dataservice-read/test/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"importHelpers": true
}
}
9 changes: 5 additions & 4 deletions @here/olp-sdk-dataservice-write/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"scripts": {
"build": "tsc",
"lint": "tslint -c tslint.json -p tsconfig.json",
"test": "mocha",
"coverage": "nyc mocha",
"test": "tsc -p ./test/tsconfig.json && mocha",
"coverage": "nyc npm run test",
"codecov": "npm run coverage && nyc report --reporter=lcov",
"prepare": "tsc --sourceMap false && npm run bundle",
"webpack": "webpack",
Expand Down Expand Up @@ -57,7 +57,7 @@
"devDependencies": {
"@types/chai": "^4.2.7",
"@types/mocha": "^5.2.7",
"@types/node": "^13.1.2",
"@types/node": "^14.11.8",
"@types/sinon": "7.0.3",
"@types/sinon-chai": "^3.2.3",
"awesome-typescript-loader": "^5.2.1",
Expand All @@ -75,7 +75,8 @@
"tslint": "^5.20.1",
"tslint-config-prettier": "^1.18.0",
"typedoc": "^0.15.0",
"typescript": "3.5.3",
"typescript": "4.0.3",
"tslib": "1.13.0",
"webpack": "^4.41.5",
"webpack-cli": "^3.3.10"
}
Expand Down
6 changes: 6 additions & 0 deletions @here/olp-sdk-dataservice-write/test/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"importHelpers": true
}
}
9 changes: 5 additions & 4 deletions @here/olp-sdk-fetch/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"scripts": {
"build": "tsc",
"lint": "tslint -c tslint.json -p tsconfig.json",
"test": "mocha",
"coverage": "nyc mocha",
"test": "tsc -p ./test/tsconfig.json && mocha",
"coverage": "nyc npm run test",
"codecov": "npm run coverage && nyc report --reporter=lcov",
"prepare": "tsc --sourceMap false && npm run bundle",
"bundle": "npm run bundle:dev && npm run bundle:prod",
Expand Down Expand Up @@ -53,7 +53,7 @@
"devDependencies": {
"@types/chai": "^4.2.7",
"@types/mocha": "^5.2.7",
"@types/node": "^13.1.2",
"@types/node": "^14.11.8",
"@types/sinon": "7.0.3",
"@types/sinon-chai": "^3.2.3",
"awesome-typescript-loader": "^5.2.1",
Expand All @@ -71,7 +71,8 @@
"tslint": "^5.20.1",
"tslint-config-prettier": "^1.18.0",
"typedoc": "^0.15.0",
"typescript": "3.5.3",
"typescript": "4.0.3",
"tslib": "1.13.0",
"webpack": "^4.41.5",
"webpack-cli": "^3.3.10",
"zlib": "^1.0.5"
Expand Down
6 changes: 6 additions & 0 deletions @here/olp-sdk-fetch/test/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"importHelpers": true
}
}
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,14 @@
"typedoc": "npx typedoc --disableOutputCheck --options typedoc.json"
},
"devDependencies": {
"@types/node": "^13.1.2",
"@types/node": "^14.11.8",
"lerna": "^3.20.2",
"typescript": "3.5.3",
"typescript": "4.0.3",
"tslib": "1.13.0",
"codecov": "3.7.2",
"mockserver-node": "5.9.0",
"mockserver-client": "5.9.0",
"ts-node": "8.6.2",
"ts-node": "9.0.0",
"puppeteer": "^2.1.1",
"puppeteer-to-istanbul": "^1.2.2",
"nyc": "^15.0.0",
Expand Down
Loading

0 comments on commit c4c6134

Please sign in to comment.