mirror of
https://github.com/jspsych/jsPsych.git
synced 2025-05-12 08:38:11 +00:00
fix tests for addNodeToEndOfTimeline (no longer accepts callback)
This commit is contained in:
parent
c8298e226f
commit
a106dbbd13
@ -438,7 +438,7 @@ describe('nested timelines', function() {
|
|||||||
|
|
||||||
describe('add node to end of timeline', function(){
|
describe('add node to end of timeline', function(){
|
||||||
|
|
||||||
test('adds node to end of timeline, without callback', function() {
|
test('adds node to end of timeline', function() {
|
||||||
var new_trial = {
|
var new_trial = {
|
||||||
type: 'html-keyboard-response',
|
type: 'html-keyboard-response',
|
||||||
stimulus: 'bar'
|
stimulus: 'bar'
|
||||||
@ -468,31 +468,5 @@ describe('add node to end of timeline', function(){
|
|||||||
utils.pressKey('a');
|
utils.pressKey('a');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('adds node to end of timeline, with callback', function() {
|
|
||||||
var t = {
|
|
||||||
type: 'html-keyboard-response',
|
|
||||||
stimulus: 'foo',
|
|
||||||
on_finish: function(){
|
|
||||||
jsPsych.pauseExperiment();
|
|
||||||
jsPsych.addNodeToEndOfTimeline({
|
|
||||||
timeline: [{
|
|
||||||
type: 'html-keyboard-response',
|
|
||||||
stimulus: 'bar'
|
|
||||||
}]
|
|
||||||
}, jsPsych.resumeExperiment)
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
jsPsych.init({
|
|
||||||
timeline: [t]
|
|
||||||
});
|
|
||||||
|
|
||||||
expect(jsPsych.getDisplayElement().innerHTML).toMatch('foo');
|
|
||||||
utils.pressKey('a');
|
|
||||||
expect(jsPsych.getDisplayElement().innerHTML).toMatch('bar');
|
|
||||||
utils.pressKey('a');
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user