diff --git a/packages/jspsych/tests/citations/citations.test.ts b/packages/jspsych/tests/citations/citations.test.ts index a03e26c6..93431bd9 100644 --- a/packages/jspsych/tests/citations/citations.test.ts +++ b/packages/jspsych/tests/citations/citations.test.ts @@ -16,12 +16,16 @@ let JsPsych; * This is because the citation functionality is only available in the built version * due to code injections that run during the build. */ - try { // Try to import built version JsPsych = require("../../dist/index").JsPsych; let jspsych: typeof JsPsych; + // Check if getCitations exists in current built version + if (!jspsych.hasOwnProperty("getCitations")) { + throw new Error("getCitations not found"); + } + beforeEach(() => { jspsych = new JsPsych(); }); @@ -35,7 +39,7 @@ try { }); test("citing without input and with invalid format", () => { expect(() => jspsych.getCitations(null, "apa")).toThrow( - "Expected array of plugins/extensions" + "Expected array of plugins/extensionss" ); }); });