mirror of
https://github.com/jspsych/jsPsych.git
synced 2025-05-10 11:10:54 +00:00
check if getCitations()
exists in build
This commit is contained in:
parent
9e60268ba0
commit
ac4272fd56
@ -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"
|
||||
);
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user