add working test

This commit is contained in:
Josh de Leeuw 2021-01-07 16:13:34 -05:00
parent 3f1abdec88
commit 83a6ea61c9

View 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');
})
})