mirror of
https://github.com/jspsych/jsPsych.git
synced 2025-05-12 16:48:12 +00:00
add working test
This commit is contained in:
parent
3f1abdec88
commit
83a6ea61c9
24
tests/jsPsych.pluginAPI/preloads.test.js
Normal file
24
tests/jsPsych.pluginAPI/preloads.test.js
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
const root = '../../';
|
||||||
|
const utils = require('../testing-utils.js');
|
||||||
|
|
||||||
|
beforeEach(function(){
|
||||||
|
require(root + 'jspsych.js');
|
||||||
|
require(root + 'plugins/jspsych-html-keyboard-response.js');
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('getAutoPreloadList', function(){
|
||||||
|
test('works with images', function(){
|
||||||
|
require(root + 'plugins/jspsych-image-keyboard-response.js');
|
||||||
|
|
||||||
|
var t = {
|
||||||
|
type: 'image-keyboard-response',
|
||||||
|
stimulus: 'img/foo.png'
|
||||||
|
}
|
||||||
|
|
||||||
|
var timeline = [t];
|
||||||
|
|
||||||
|
var images = jsPsych.pluginAPI.getAutoPreloadList(timeline).images;
|
||||||
|
|
||||||
|
expect(images[0]).toBe('img/foo.png');
|
||||||
|
})
|
||||||
|
})
|
Loading…
Reference in New Issue
Block a user