Skip to content

Commit

Permalink
test(index): fix skipped test
Browse files Browse the repository at this point in the history
  • Loading branch information
Fdawgs committed Jul 30, 2024
1 parent 4fff485 commit 6a1f35d
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ describe("Node-Poppler module", () => {
({ platform } = process);
});

beforeEach(() => {
jest.resetModules();
});

afterEach(() => {
// Restore the process platform
Object.defineProperty(process, "platform", {
Expand All @@ -79,19 +83,13 @@ describe("Node-Poppler module", () => {
expect(poppler.popplerPath).toBe(testBinaryPath);
});

/**
* @todo Fix this test, mocking of "node:" scheme not supported yet.
* @see {@link https://github.com/jestjs/jest/pull/14297 | Jest PR #14297}
*/
// eslint-disable-next-line jest/no-disabled-tests -- Blocked by Jest PR #14297
it.skip("Throws an Error if the binary path is not found", () => {
it("Throws an Error if the binary path is not found", () => {
Object.defineProperty(process, "platform", {
value: "mockOS",
});

// Ensure the mock is used by the UnRTF constructor
jest.resetModules();
jest.mock("node:child_process", () => ({
jest.doMock("node:child_process", () => ({
...jest.requireActual("node:child_process"),
spawnSync: jest.fn(() => ({
stdout: {
toString: () => "",
Expand Down

0 comments on commit 6a1f35d

Please sign in to comment.