Skip to content

Commit 261d432

Browse files
committed
Remove unnecesary tests
1 parent 0a49167 commit 261d432

File tree

7 files changed

+83
-155
lines changed

7 files changed

+83
-155
lines changed

packages/db-client/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@
4848
"@grpc/grpc-js": "^1.12.4",
4949
"@types/debug": "^4.1.12",
5050
"@types/google-protobuf": "^3.15.12",
51-
"@types/node": "^16.18.67",
52-
"debug": "^4.3.2",
53-
"google-protobuf": "^3.21.2",
54-
"uuid": "^8.3.2"
51+
"@types/node": "^22.10.2",
52+
"debug": "^4.4.0",
53+
"google-protobuf": "^3.21.4",
54+
"uuid": "^11.0.3"
5555
},
5656
"devDependencies": {
57-
"@types/uuid": "^8.3.4",
57+
"@types/uuid": "^10.0.0",
5858
"grpc-tools": "^1.12.4",
5959
"grpc_tools_node_protoc_ts": "^5.3.3",
6060
"npm-run-all": "^4.1.5",

packages/db-client/src/Client/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ export class Client {
523523
}
524524

525525
if (error.message.includes("RST_STREAM")) {
526-
return [true]
526+
return [true];
527527
}
528528

529529
return [

packages/opentelemetry/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
},
3434
"dependencies": {
3535
"@opentelemetry/api": "^1.8.0",
36-
"@opentelemetry/instrumentation": "^0.50.0"
36+
"@opentelemetry/instrumentation": "^0.56.0"
3737
},
3838
"devDependencies": {
3939
"@eventstore/db-client": "file:../db-client"

packages/opentelemetry/src/instrumentation.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ import type { Subscription } from "@eventstore/db-client/src/streams/utils/Subsc
3939
import { INSTRUMENTATION_NAME, INSTRUMENTATION_VERSION } from "./version";
4040
import type {
4141
AppendToStreamParams,
42-
SubscribeParameters,
4342
PersistentSubscribeParameters,
43+
SubscribeParameters,
4444
} from "./types";
4545
import { hasConvertGrpcEventMethod, isJSONEventData } from "./utils";
4646

@@ -53,16 +53,12 @@ export class Instrumentation extends InstrumentationBase {
5353
}
5454

5555
protected init() {
56-
const moduleDefinition = new InstrumentationNodeModuleDefinition<
57-
typeof kdb
58-
>(
56+
return new InstrumentationNodeModuleDefinition(
5957
"@eventstore/db-client",
6058
["6.*"],
6159
this._onPatchMain(),
6260
this._onUnPatchMain()
6361
);
64-
65-
return moduleDefinition;
6662
}
6763

6864
private _onPatchMain() {

packages/test/src/connection/deadline/deadline-settings.test.ts

Lines changed: 1 addition & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -1,103 +1,6 @@
1-
import { Channel } from "@grpc/grpc-js";
2-
3-
import {
4-
BaseOptions,
5-
DNSClusterOptions,
6-
KurrentDBClient,
7-
} from "@eventstore/db-client";
8-
9-
/*
10-
Mocking this file breaks grpc, but allows us to check the settings passed to grpc
11-
These tests need to be kept seperate to any tests that need to actually make calls
12-
*/
13-
jest.mock("@grpc/grpc-js/build/src/channel.js");
14-
const ChannelMock = Channel as jest.Mock<Channel>;
1+
import { DNSClusterOptions, KurrentDBClient } from "@eventstore/db-client";
152

163
describe("deadline", () => {
17-
beforeEach(() => {
18-
ChannelMock.mockClear();
19-
});
20-
21-
describe.each<
22-
[
23-
test_name: string,
24-
connection_string: string,
25-
constructor_options: Partial<DNSClusterOptions>,
26-
call_options: BaseOptions,
27-
expected: number
28-
]
29-
>([
30-
["should default to 10_000", "esdb://host", {}, {}, 10_000],
31-
[
32-
"should be settable: 1",
33-
"esdb://host?defaultDeadline=1",
34-
{ defaultDeadline: 1 },
35-
{},
36-
1,
37-
],
38-
[
39-
"should be settable: 100000",
40-
"esdb://host?defaultDeadline=100000",
41-
{ defaultDeadline: 10_0000 },
42-
{},
43-
10_0000,
44-
],
45-
[
46-
"passing in call options should override default",
47-
"esdb://host",
48-
{},
49-
{ deadline: 10_0000 },
50-
10_0000,
51-
],
52-
[
53-
"passing in call options should override settings",
54-
"esdb://host?defaultDeadline=100000",
55-
{ defaultDeadline: 10_0000 },
56-
{ deadline: 10 },
57-
10,
58-
],
59-
])("%s", (_, connectionString, constructorOptions, callOptions, expected) => {
60-
test.each([
61-
[
62-
"connectionString",
63-
() => KurrentDBClient.connectionString(connectionString),
64-
],
65-
[
66-
"constructor",
67-
() =>
68-
new KurrentDBClient({
69-
endpoint: "host:1234",
70-
...constructorOptions,
71-
}),
72-
],
73-
])("%s", async (_, createClient) => {
74-
const warnSpy = jest.spyOn(console, "warn").mockImplementation();
75-
const client = createClient();
76-
const before = Date.now();
77-
78-
try {
79-
await client.restartSubsystem(callOptions);
80-
} catch (_) {
81-
// We're not actually connecting to anything, just triggering channel creation
82-
}
83-
84-
const after = Date.now();
85-
86-
const ChannelInstance = ChannelMock.mock.instances[0];
87-
const createCall = ChannelInstance.createCall as unknown as jest.Mock<
88-
Channel["createCall"]
89-
>;
90-
91-
const deadline = createCall.mock.calls[0][1].getTime();
92-
93-
expect(deadline).toBeGreaterThanOrEqual(before + expected);
94-
expect(deadline).toBeLessThanOrEqual(after + expected);
95-
96-
expect(warnSpy).not.toBeCalled();
97-
warnSpy.mockRestore();
98-
});
99-
});
100-
1014
describe.each<
1025
[
1036
test_name: string,

packages/test/src/utils/Cluster.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import type { EndPoint, Certificate } from "@eventstore/db-client";
1111

1212
import { testDebug } from "./debug";
1313
import { dockerImages } from "./dockerImages";
14-
import {kill} from "docker-compose";
14+
import { kill } from "docker-compose";
1515

1616
const rmdir = promisify(fs.rm);
1717
const mkdir = promisify(fs.mkdir);

0 commit comments

Comments
 (0)