From f043760b5499537a60893bfb9d7af903becff132 Mon Sep 17 00:00:00 2001 From: Tim van der Meij Date: Sun, 13 Apr 2025 14:14:19 +0200 Subject: [PATCH] Isolate the find integration tests To avoid being able to introduce dependencies between tests this commit makes sure that we close the document between tests so that we can't accidentally rely on state set by a previous test. --- test/integration/find_spec.mjs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/integration/find_spec.mjs b/test/integration/find_spec.mjs index e6f05072e..257f357cd 100644 --- a/test/integration/find_spec.mjs +++ b/test/integration/find_spec.mjs @@ -28,11 +28,11 @@ describe("find bar", () => { describe("highlight all", () => { let pages; - beforeAll(async () => { + beforeEach(async () => { pages = await loadAndWait("find_all.pdf", ".textLayer", 100); }); - afterAll(async () => { + afterEach(async () => { await closePages(pages); }); @@ -89,11 +89,11 @@ describe("find bar", () => { describe("highlight all (XFA)", () => { let pages; - beforeAll(async () => { + beforeEach(async () => { pages = await loadAndWait("xfa_imm5257e.pdf", ".xfaLayer"); }); - afterAll(async () => { + afterEach(async () => { await closePages(pages); }); @@ -130,11 +130,11 @@ describe("find bar", () => { describe("issue19207.pdf", () => { let pages; - beforeAll(async () => { + beforeEach(async () => { pages = await loadAndWait("issue19207.pdf", ".textLayer", 200); }); - afterAll(async () => { + afterEach(async () => { await closePages(pages); });