Skip to content

Commit

Permalink
Add unit tests for shouldWaitForHaveEnoughData
Browse files Browse the repository at this point in the history
  • Loading branch information
peaBerberian committed Jun 28, 2023
1 parent 790bcc3 commit c2d53c6
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions src/compat/__tests__/should_wait_for_have_enough_data.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-var-requires */
/* eslint-disable @typescript-eslint/no-unsafe-call */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable @typescript-eslint/no-unsafe-return */

describe("compat - shouldWaitForHaveEnoughData", () => {
beforeEach(() => {
jest.resetModules();
});

it("should return false if we are not on the Playstation 5", () => {
jest.mock("../browser_detection", () => {
return {
__esModule: true as const,
isPlayStation5: false,
};
});
const shouldWaitForHaveEnoughData =
jest.requireActual("../should_wait_for_have_enough_data");
expect(shouldWaitForHaveEnoughData.default()).toBe(false);
});

it("should return true if we are on the Playstation 5", () => {
jest.mock("../browser_detection", () => {
return {
__esModule: true as const,
isPlayStation5: true,
};
});
const shouldWaitForHaveEnoughData =
jest.requireActual("../should_wait_for_have_enough_data");
expect(shouldWaitForHaveEnoughData.default()).toBe(true);
});
});

0 comments on commit c2d53c6

Please sign in to comment.