Skip to content

Commit 1c15bc5

Browse files
committed
[CHORE] upgrade jest
1 parent 9b7ea46 commit 1c15bc5

6 files changed

Lines changed: 880 additions & 944 deletions

File tree

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
"format": "prettier --write \"src/**\" \"README.md\""
1919
},
2020
"devDependencies": {
21-
"@types/jest": "^27.4.0",
21+
"@types/jest": "^30.0.0",
2222
"@types/mock-fs": "4.13.0",
2323
"@types/serverless": "3.12.27",
24-
"jest": "^29.7.0",
24+
"jest": "^30.2.0",
2525
"jest-environment-node": "^30.2.0",
2626
"mock-fs": "4.13.0",
2727
"prettier": "^3.6.2",

src/env.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1184,7 +1184,7 @@ describe("setEnvConfiguration", () => {
11841184
},
11851185
handlers,
11861186
);
1187-
}).toThrowError("When `llmObsEnabled` is true, `llmObsMlApp` must also be set.");
1187+
}).toThrow("When `llmObsEnabled` is true, `llmObsMlApp` must also be set.");
11881188
});
11891189

11901190
it("throws error when `llmObsMlApp` is set to an invalid value", () => {
@@ -1227,7 +1227,7 @@ describe("setEnvConfiguration", () => {
12271227
},
12281228
handlers,
12291229
);
1230-
}).toThrowError(
1230+
}).toThrow(
12311231
"`llmObsMlApp` must only contain up to 193 alphanumeric characters, hyphens, underscores, periods, and slashes.",
12321232
);
12331233
});
@@ -1271,7 +1271,7 @@ describe("setEnvConfiguration", () => {
12711271
},
12721272
handlers,
12731273
);
1274-
}).toThrowError(
1274+
}).toThrow(
12751275
"apiKeySecretArn` is not supported for Node runtimes when using Synchronous Metrics. Set DATADOG_API_KEY in your environment, or use `apiKmsKey` in the configuration.",
12761276
);
12771277
});

src/index.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1576,7 +1576,7 @@ describe("ServerlessPlugin", () => {
15761576
const plugin = new ServerlessPlugin(serverless, {});
15771577
expect(async () => {
15781578
await plugin.hooks["after:datadog:generate:init"]();
1579-
}).rejects.toThrowError(
1579+
}).rejects.toThrow(
15801580
"The following configuration options have been removed: subscribeToApiGatewayLogs. Please use the subscribeToAccessLogs or subscribeToExecutionLogs options instead.",
15811581
);
15821582
});
@@ -1620,7 +1620,7 @@ describe("ServerlessPlugin", () => {
16201620
const plugin = new ServerlessPlugin(serverless, {});
16211621
expect(async () => {
16221622
await plugin.hooks["after:datadog:generate:init"]();
1623-
}).rejects.toThrowError(
1623+
}).rejects.toThrow(
16241624
"The following configuration options have been removed: subscribeToApiGatewayLogs subscribeToHttpApiLogs subscribeToWebsocketLogs. Please use the subscribeToAccessLogs or subscribeToExecutionLogs options instead.",
16251625
);
16261626
});

src/monitor-api-requests.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ describe("searchMonitor", () => {
445445
(fetch as unknown as jest.Mock).mockReturnValue({ status: 403, statusText: "Unauthorized" });
446446
await expect(
447447
async () => await searchMonitors("datadoghq.com", "queryString", "apikey", "appkey"),
448-
).rejects.toThrowError("Can't fetch monitors. Status code: 403. Message: Unauthorized");
448+
).rejects.toThrow("Can't fetch monitors. Status code: 403. Message: Unauthorized");
449449
});
450450
});
451451

src/span-link.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ describe("mergeStepFunctionAndLambdaTraces option related tests", () => {
4343
const service = serviceWithResources();
4444
const serverless: Serverless = service.serverless;
4545
mergeStepFunctionAndLambdaTraces(resources, serverless);
46-
expect(stepFunctionsHelper.updateDefinitionString).toBeCalledTimes(0);
46+
expect(stepFunctionsHelper.updateDefinitionString).toHaveBeenCalledTimes(0);
4747
});
4848

4949
it("have one state machine in the resources", async () => {
@@ -63,7 +63,7 @@ describe("mergeStepFunctionAndLambdaTraces option related tests", () => {
6363
const service = serviceWithResources();
6464
const serverless: Serverless = service.serverless;
6565
mergeStepFunctionAndLambdaTraces(resources, serverless);
66-
expect(stepFunctionsHelper.updateDefinitionString).toBeCalledTimes(1);
66+
expect(stepFunctionsHelper.updateDefinitionString).toHaveBeenCalledTimes(1);
6767
});
6868

6969
it("can handle a steate machine with a string DefinitionString", async () => {
@@ -82,7 +82,7 @@ describe("mergeStepFunctionAndLambdaTraces option related tests", () => {
8282
const service = serviceWithResources();
8383
const serverless: Serverless = service.serverless;
8484
mergeStepFunctionAndLambdaTraces(resources, serverless);
85-
expect(stepFunctionsHelper.updateDefinitionString).toBeCalledTimes(1);
85+
expect(stepFunctionsHelper.updateDefinitionString).toHaveBeenCalledTimes(1);
8686
});
8787

8888
it("have two state machine in the resources", async () => {
@@ -110,7 +110,7 @@ describe("mergeStepFunctionAndLambdaTraces option related tests", () => {
110110
const service = serviceWithResources();
111111
const serverless: Serverless = service.serverless;
112112
mergeStepFunctionAndLambdaTraces(resources, serverless);
113-
expect(stepFunctionsHelper.updateDefinitionString).toBeCalledTimes(2);
113+
expect(stepFunctionsHelper.updateDefinitionString).toHaveBeenCalledTimes(2);
114114
});
115115
});
116116
});

0 commit comments

Comments
 (0)