diff --git a/tests/spec/core/biblio-spec.js b/tests/spec/core/biblio-spec.js index 7fd1a94895..1be0ee41b7 100644 --- a/tests/spec/core/biblio-spec.js +++ b/tests/spec/core/biblio-spec.js @@ -59,18 +59,17 @@ describe("W3C — Bibliographic References", () => { `; afterAll(flushIframes); - let isSpecRefAvailable = false; const bibRefsURL = new URL("https://specref.herokuapp.com/bibrefs"); let doc; + let specRefOk; beforeAll(async () => { doc = await makeRSDoc({ config, body }); + specRefOk = (await fetch(bibRefsURL, { method: "HEAD" })).ok; }); - it("pings biblio service to see if it's running", async () => { - const res = await fetch(bibRefsURL, { method: "HEAD" }); - expect(res.ok).toBeTruthy(); - isSpecRefAvailable = res.ok; + it("pings biblio service to see if it's running", () => { + expect(specRefOk).toBeTruthy(); }); it("includes a dns-prefetch to bibref server", () => { @@ -85,7 +84,7 @@ describe("W3C — Bibliographic References", () => { let ref = doc.querySelector("#bib-TestRef1 + dd"); expect(ref).toBeTruthy(); // This prevents Jasmine from taking down the whole test suite if SpecRef is down. - if (!isSpecRefAvailable) { + if (!specRefOk) { throw new Error( "SpecRef seems to be down. Can't proceed with this spec." );