mirror of
https://github.com/jspsych/jsPsych.git
synced 2025-05-10 11:10:54 +00:00
reactivate old test, remove deprecated toThrowError()
calls
This commit is contained in:
parent
ad1d854f43
commit
c8bda3c35b
@ -586,10 +586,10 @@ describe("Timeline", () => {
|
|||||||
const variable = new TimelineVariable("x");
|
const variable = new TimelineVariable("x");
|
||||||
|
|
||||||
await timeline.run();
|
await timeline.run();
|
||||||
expect(() => timeline.evaluateTimelineVariable(variable)).toThrowError("");
|
expect(() => timeline.evaluateTimelineVariable(variable)).toThrow();
|
||||||
expect(() =>
|
expect(() =>
|
||||||
(timeline.children[0] as Timeline).evaluateTimelineVariable(variable)
|
(timeline.children[0] as Timeline).evaluateTimelineVariable(variable)
|
||||||
).toThrowError("");
|
).toThrow();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -524,7 +524,7 @@ describe("Trial", () => {
|
|||||||
);
|
);
|
||||||
await expect(
|
await expect(
|
||||||
createTrial({ type: TestPlugin, requiredComplexNested: {} }).run()
|
createTrial({ type: TestPlugin, requiredComplexNested: {} }).run()
|
||||||
).rejects.toThrowError('"requiredComplexNested.requiredChild" parameter');
|
).rejects.toThrow('"requiredComplexNested.requiredChild" parameter');
|
||||||
});
|
});
|
||||||
|
|
||||||
it("errors on missing parameters nested in `COMPLEX` array parameters", async () => {
|
it("errors on missing parameters nested in `COMPLEX` array parameters", async () => {
|
||||||
|
@ -400,8 +400,7 @@ describe("timeline variables are correctly evaluated", () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// using console.warn instead of error for now. plan is to enable this test with version 8.
|
test("throws an error when variable doesn't exist", async () => {
|
||||||
test.skip("timelineVariable() throws an error when variable doesn't exist", async () => {
|
|
||||||
const jsPsych = initJsPsych();
|
const jsPsych = initJsPsych();
|
||||||
const { expectFinished } = await startTimeline(
|
const { expectFinished } = await startTimeline(
|
||||||
[
|
[
|
||||||
@ -411,7 +410,7 @@ test.skip("timelineVariable() throws an error when variable doesn't exist", asyn
|
|||||||
type: htmlKeyboardResponse,
|
type: htmlKeyboardResponse,
|
||||||
stimulus: "foo",
|
stimulus: "foo",
|
||||||
on_start: () => {
|
on_start: () => {
|
||||||
expect(() => jsPsych.evaluateTimelineVariable("c")).toThrowError();
|
expect(() => jsPsych.evaluateTimelineVariable("c")).toThrow();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
@ -430,7 +429,7 @@ test.skip("timelineVariable() throws an error when variable doesn't exist", asyn
|
|||||||
await expectFinished();
|
await expectFinished();
|
||||||
});
|
});
|
||||||
|
|
||||||
test("timelineVariable() can fetch a variable called 'data'", async () => {
|
test("can fetch a variable called 'data'", async () => {
|
||||||
const jsPsych = initJsPsych();
|
const jsPsych = initJsPsych();
|
||||||
const { expectFinished } = await startTimeline(
|
const { expectFinished } = await startTimeline(
|
||||||
[
|
[
|
||||||
@ -440,7 +439,7 @@ test("timelineVariable() can fetch a variable called 'data'", async () => {
|
|||||||
type: htmlKeyboardResponse,
|
type: htmlKeyboardResponse,
|
||||||
stimulus: "foo",
|
stimulus: "foo",
|
||||||
on_start: () => {
|
on_start: () => {
|
||||||
expect(() => jsPsych.evaluateTimelineVariable("data")).not.toThrowError();
|
expect(() => jsPsych.evaluateTimelineVariable("data")).not.toThrow();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
@ -198,7 +198,7 @@ describe("randomInt", () => {
|
|||||||
test("setting upper < lower throws an error", () => {
|
test("setting upper < lower throws an error", () => {
|
||||||
expect(() => {
|
expect(() => {
|
||||||
randomInt(1, 0);
|
randomInt(1, 0);
|
||||||
}).toThrowError();
|
}).toThrow();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ describe("video-keyboard-response", () => {
|
|||||||
|
|
||||||
await expect(async () => {
|
await expect(async () => {
|
||||||
await jsPsych.run(timeline);
|
await jsPsych.run(timeline);
|
||||||
}).rejects.toThrowError();
|
}).rejects.toThrow();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ describe("video-slider-response", () => {
|
|||||||
|
|
||||||
await expect(async () => {
|
await expect(async () => {
|
||||||
await jsPsych.run(timeline);
|
await jsPsych.run(timeline);
|
||||||
}).rejects.toThrowError();
|
}).rejects.toThrow();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user