Skip to content

Commit 1d8740b

Browse files
New typescript linting fixes
1 parent 45e8d5b commit 1d8740b

File tree

8 files changed

+788
-1305
lines changed

8 files changed

+788
-1305
lines changed

jest.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1+
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
12
module.exports = {
23
preset: 'ts-jest',
3-
testEnvironment: 'node'
4+
testEnvironment: 'node',
45
};

package-lock.json

Lines changed: 759 additions & 1283 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "dapr-client",
3-
"version": "0.3.1",
3+
"version": "1.0.0",
44
"description": "The official Dapr (https://dapr.io) SDK for Node.js",
55
"types": "http/index.d.ts",
66
"scripts": {
@@ -19,31 +19,31 @@
1919
"author": "Xavier Geerinck",
2020
"license": "ISC",
2121
"dependencies": {
22-
"@grpc/grpc-js": "^1.3.2",
23-
"@js-temporal/polyfill": "^0.1.0",
22+
"@grpc/grpc-js": "^1.3.7",
23+
"@js-temporal/polyfill": "^0.2.0",
2424
"body-parser": "^1.19.0",
25-
"google-protobuf": "^3.15.8",
26-
"grpc": "^1.24.10",
25+
"google-protobuf": "^3.18.0",
2726
"node-fetch": "^2.6.1",
27+
"grpc": "^1.24.10",
2828
"restana": "^4.9.1",
2929
"uuid": "^8.3.2"
3030
},
3131
"devDependencies": {
32-
"@types/body-parser": "^1.19.0",
33-
"@types/google-protobuf": "^3.15.2",
32+
"@types/body-parser": "^1.19.1",
33+
"@types/google-protobuf": "^3.15.5",
3434
"@types/jest": "^27.0.1",
35-
"@types/node": "^15.0.3",
35+
"@types/node": "^16.9.1",
3636
"@types/node-fetch": "^2.5.8",
3737
"@types/uuid": "^8.3.1",
38-
"grpc-tools": "^1.11.1",
39-
"grpc_tools_node_protoc_ts": "^5.2.2",
40-
"jest": "^27.0.6",
41-
"nodemon": "^2.0.7",
42-
"prettier": "^2.2.1",
43-
"ts-jest": "^27.0.4",
38+
"grpc-tools": "^1.11.2",
39+
"grpc_tools_node_protoc_ts": "^5.3.2",
40+
"jest": "^27.2.0",
41+
"nodemon": "^2.0.12",
42+
"prettier": "^2.4.0",
43+
"ts-jest": "^27.0.5",
4444
"tslint": "^6.1.3",
4545
"tslint-config-prettier": "^1.18.0",
46-
"typescript": "^4.2.3"
46+
"typescript": "^4.4.3"
4747
},
4848
"repository": {
4949
"type": "git",

src/actors/runtime/ActorStateManager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ export default class ActorStateManager<T> {
169169
return val;
170170
}
171171

172-
const changeKind = this.isStateMarkedForRemove(stateName) ? StateChangeKind.UPDATE : StateChangeKind.ADD;
172+
const changeKind = await this.isStateMarkedForRemove(stateName) ? StateChangeKind.UPDATE : StateChangeKind.ADD;
173173
stateChangeTracker.set(stateName, new StateMetadata(value, changeKind));
174174

175175
return value;

src/implementation/Server/HTTPServer/binding.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,11 @@ export default class HTTPServerBinding implements IServerBinding {
3737
} catch (e) {
3838
res.statusCode = HttpStatusCode.INTERNAL_SERVER_ERROR;
3939

40+
console.debug(e);
41+
4042
return res.end(JSON.stringify({
4143
error: "COULD_NOT_PROCESS_CALLBACK",
42-
error_msg: `Something happened while processing the input binding callback - ${e.message}`
44+
error_msg: `Something happened while processing the input binding callback`
4345
}));
4446
}
4547
});

test/unit/actor/actorRuntime.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ describe('ActorRuntime', () => {
109109
try {
110110
await runtime.invoke(DemoActorCounterImpl.name, actorId, "someRandomMethod");
111111
} catch (e) {
112-
expect(e.message).toEqual(`{"error":"ACTOR_METHOD_DOES_NOT_EXIST","errorMsg":"The actor method 'someRandomMethod' does not exist on ${DemoActorCounterImpl.name}"}`);
112+
let msg = (e as Error).message;
113+
expect(msg).toEqual(`{"error":"ACTOR_METHOD_DOES_NOT_EXIST","errorMsg":"The actor method 'someRandomMethod' does not exist on ${DemoActorCounterImpl.name}"}`);
113114
}
114115
});
115116

test/unit/main/DaprClient.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ describe('DaprClient', () => {
1414
try {
1515
const client = new DaprClient(host, host);
1616
} catch (e) {
17-
expect(e.message).toEqual("DAPR_CLIENT_INCORRECT_PORT");
17+
let msg = (e as Error).message;
18+
expect(msg).toEqual("DAPR_CLIENT_INCORRECT_PORT");
1819
}
1920
});
2021
});

test/unit/main/DaprServer.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,17 @@ describe('DaprServer', () => {
1414
try {
1515
const server = new DaprServer(host, host);
1616
} catch (e) {
17-
expect(e.message).toEqual("DAPR_SERVER_INCORRECT_SERVER_PORT");
17+
let msg = (e as Error).message;
18+
expect(msg).toEqual("DAPR_SERVER_INCORRECT_SERVER_PORT");
1819
}
1920
});
2021

2122
it('should throw an error on a wrong port for client', () => {
2223
try {
2324
const server = new DaprServer(host, port, host, host);
2425
} catch (e) {
25-
expect(e.message).toEqual("DAPR_SERVER_INCORRECT_SIDECAR_PORT");
26+
let msg = (e as Error).message;
27+
expect(msg).toEqual("DAPR_SERVER_INCORRECT_SIDECAR_PORT");
2628
}
2729
});
2830
});

0 commit comments

Comments
 (0)