mirror of
https://github.com/jspsych/jsPsych.git
synced 2025-05-10 19:20:55 +00:00
Fix callback invocations in MediaAPI tests
This commit is contained in:
parent
cb65c67935
commit
5ef21c5247
@ -381,8 +381,10 @@ describe("preload plugin", () => {
|
|||||||
jest
|
jest
|
||||||
.spyOn(pluginAPI, "preloadImages")
|
.spyOn(pluginAPI, "preloadImages")
|
||||||
.mockImplementation((x, cb_complete, cb_load, cb_error) => {
|
.mockImplementation((x, cb_complete, cb_load, cb_error) => {
|
||||||
cb_load();
|
if (x.includes("image.png")) {
|
||||||
cb_complete();
|
cb_load("image.png");
|
||||||
|
cb_complete();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const { getHTML } = await startTimeline(
|
const { getHTML } = await startTimeline(
|
||||||
@ -623,7 +625,7 @@ describe("preload plugin", () => {
|
|||||||
.spyOn(pluginAPI, "preloadImages")
|
.spyOn(pluginAPI, "preloadImages")
|
||||||
.mockImplementation((x, cb_complete, cb_load, cb_error) => {
|
.mockImplementation((x, cb_complete, cb_load, cb_error) => {
|
||||||
if (x.includes("blue.png")) {
|
if (x.includes("blue.png")) {
|
||||||
cb_load();
|
cb_load("blue.png");
|
||||||
cb_complete();
|
cb_complete();
|
||||||
} else {
|
} else {
|
||||||
cb_error({
|
cb_error({
|
||||||
@ -734,7 +736,7 @@ describe("preload plugin", () => {
|
|||||||
.spyOn(pluginAPI, "preloadImages")
|
.spyOn(pluginAPI, "preloadImages")
|
||||||
.mockImplementation((x, cb_complete, cb_load, cb_error) => {
|
.mockImplementation((x, cb_complete, cb_load, cb_error) => {
|
||||||
if (x.includes("blue.png")) {
|
if (x.includes("blue.png")) {
|
||||||
cb_load();
|
cb_load("blue.png");
|
||||||
cb_complete();
|
cb_complete();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user