Skip to content

Commit bfaa816

Browse files
committed
fix: better reset limit in test.
1 parent a7cb6bd commit bfaa816

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

express-zod-api/tests/common-helpers.spec.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { makeRequestMock } from "../src/testing";
1818
import { methods } from "../src/method";
1919
import { CommonConfig, InputSources } from "../src/config-type";
2020
import * as R from "ramda";
21+
import { afterAll } from "vitest";
2122

2223
describe("Common Helpers", () => {
2324
describe("emptySchema", () => {
@@ -270,6 +271,10 @@ describe("Common Helpers", () => {
270271
});
271272

272273
describe("combinations()", () => {
274+
afterAll(() => {
275+
combinations.limit = Infinity; // reset back
276+
});
277+
273278
test("should run callback on each combination of items from two arrays", () => {
274279
expect(combinations([1, 2], [4, 5, 6], R.add)).toEqual([
275280
5, 6, 7, 6, 7, 8,
@@ -290,7 +295,6 @@ describe("Common Helpers", () => {
290295
expect(combinations([1, 2], [4, 5, 6], R.add, 4)).toEqual([5, 6, 7, 6]);
291296
combinations.limit = 3;
292297
expect(combinations([1, 2], [4, 5, 6], R.add)).toEqual([5, 6, 7]);
293-
combinations.limit = Infinity;
294298
});
295299

296300
test.each([0, -1, NaN])("should return empty for limit=%s", (limit) => {

0 commit comments

Comments
 (0)