mirror of
https://github.com/jspsych/jsPsych.git
synced 2025-05-12 16:48:12 +00:00
relocate tests on core library
This commit is contained in:
parent
243c49dc74
commit
c112f930c1
@ -1,11 +1,13 @@
|
|||||||
const utils = require('./testing-utils.js');
|
const utils = require('../testing-utils.js');
|
||||||
|
|
||||||
|
beforeEach(function(){
|
||||||
|
require('../../jspsych.js');
|
||||||
|
require('../../plugins/jspsych-html-keyboard-response.js');
|
||||||
|
})
|
||||||
|
|
||||||
describe('on_finish (trial)', function(){
|
describe('on_finish (trial)', function(){
|
||||||
test('should get an object of data generated by the trial', function(){
|
test('should get an object of data generated by the trial', function(){
|
||||||
|
|
||||||
require('../jspsych.js');
|
|
||||||
require('../plugins/jspsych-html-keyboard-response.js');
|
|
||||||
|
|
||||||
return (new Promise(function(resolve, reject){
|
return (new Promise(function(resolve, reject){
|
||||||
|
|
||||||
var key_data = null;
|
var key_data = null;
|
||||||
@ -32,9 +34,6 @@ describe('on_finish (trial)', function(){
|
|||||||
|
|
||||||
test('should be able to write to the data', function(){
|
test('should be able to write to the data', function(){
|
||||||
|
|
||||||
require('../jspsych.js');
|
|
||||||
require('../plugins/jspsych-html-keyboard-response.js');
|
|
||||||
|
|
||||||
return (new Promise(function(resolve, reject){
|
return (new Promise(function(resolve, reject){
|
||||||
|
|
||||||
var promise_data = {};
|
var promise_data = {};
|
||||||
@ -67,8 +66,6 @@ describe('on_finish (trial)', function(){
|
|||||||
describe('on_start (trial)', function(){
|
describe('on_start (trial)', function(){
|
||||||
|
|
||||||
test('should get trial data with function parameters evaluated', function(){
|
test('should get trial data with function parameters evaluated', function(){
|
||||||
require('../jspsych.js');
|
|
||||||
require('../plugins/jspsych-html-keyboard-response.js');
|
|
||||||
|
|
||||||
return (new Promise(function(resolve, reject){
|
return (new Promise(function(resolve, reject){
|
||||||
|
|
||||||
@ -95,8 +92,6 @@ describe('on_start (trial)', function(){
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('should get trial data with timeline variables evaluated', function(){
|
test('should get trial data with timeline variables evaluated', function(){
|
||||||
require('../jspsych.js');
|
|
||||||
require('../plugins/jspsych-html-keyboard-response.js');
|
|
||||||
|
|
||||||
return (new Promise(function(resolve, reject){
|
return (new Promise(function(resolve, reject){
|
||||||
|
|
||||||
@ -128,8 +123,6 @@ describe('on_start (trial)', function(){
|
|||||||
|
|
||||||
describe('on_trial_finish (experiment level)', function(){
|
describe('on_trial_finish (experiment level)', function(){
|
||||||
test('should get an object containing the trial data', function(){
|
test('should get an object containing the trial data', function(){
|
||||||
require('../jspsych.js');
|
|
||||||
require('../plugins/jspsych-html-keyboard-response.js');
|
|
||||||
|
|
||||||
return (new Promise(function(resolve, reject){
|
return (new Promise(function(resolve, reject){
|
||||||
|
|
||||||
@ -159,8 +152,6 @@ describe('on_trial_finish (experiment level)', function(){
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('should allow writing to the data object', function(){
|
test('should allow writing to the data object', function(){
|
||||||
require('../jspsych.js');
|
|
||||||
require('../plugins/jspsych-html-keyboard-response.js');
|
|
||||||
|
|
||||||
return (new Promise(function(resolve, reject){
|
return (new Promise(function(resolve, reject){
|
||||||
|
|
||||||
@ -193,8 +184,6 @@ describe('on_trial_finish (experiment level)', function(){
|
|||||||
|
|
||||||
describe('on_data_update', function(){
|
describe('on_data_update', function(){
|
||||||
test('should get an object containing the trial data', function(){
|
test('should get an object containing the trial data', function(){
|
||||||
require('../jspsych.js');
|
|
||||||
require('../plugins/jspsych-html-keyboard-response.js');
|
|
||||||
|
|
||||||
return (new Promise(function(resolve, reject){
|
return (new Promise(function(resolve, reject){
|
||||||
|
|
||||||
@ -224,8 +213,6 @@ describe('on_data_update', function(){
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('should contain data added with on_finish (trial level)', function(){
|
test('should contain data added with on_finish (trial level)', function(){
|
||||||
require('../jspsych.js');
|
|
||||||
require('../plugins/jspsych-html-keyboard-response.js');
|
|
||||||
|
|
||||||
return (new Promise(function(resolve, reject){
|
return (new Promise(function(resolve, reject){
|
||||||
|
|
||||||
@ -258,8 +245,6 @@ describe('on_data_update', function(){
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('should contain data added with on_trial_finish (experiment level)', function(){
|
test('should contain data added with on_trial_finish (experiment level)', function(){
|
||||||
require('../jspsych.js');
|
|
||||||
require('../plugins/jspsych-html-keyboard-response.js');
|
|
||||||
|
|
||||||
return (new Promise(function(resolve, reject){
|
return (new Promise(function(resolve, reject){
|
||||||
|
|
||||||
@ -295,8 +280,6 @@ describe('on_data_update', function(){
|
|||||||
describe('on_trial_start', function(){
|
describe('on_trial_start', function(){
|
||||||
|
|
||||||
test('should get an object containing the trial properties', function(){
|
test('should get an object containing the trial properties', function(){
|
||||||
require('../jspsych.js');
|
|
||||||
require('../plugins/jspsych-html-keyboard-response.js');
|
|
||||||
|
|
||||||
return (new Promise(function(resolve, reject){
|
return (new Promise(function(resolve, reject){
|
||||||
|
|
||||||
@ -326,8 +309,6 @@ describe('on_trial_start', function(){
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('should allow modification of the trial properties', function(){
|
test('should allow modification of the trial properties', function(){
|
||||||
require('../jspsych.js');
|
|
||||||
require('../plugins/jspsych-html-keyboard-response.js');
|
|
||||||
|
|
||||||
var trial = {
|
var trial = {
|
||||||
type: 'html-keyboard-response',
|
type: 'html-keyboard-response',
|
@ -1,4 +1,4 @@
|
|||||||
const root = '../';
|
const root = '../../';
|
||||||
|
|
||||||
require(root + 'jspsych.js');
|
require(root + 'jspsych.js');
|
||||||
|
|
@ -1,5 +1,5 @@
|
|||||||
const root = '../';
|
const root = '../../';
|
||||||
const utils = require('./testing-utils.js');
|
const utils = require('../testing-utils.js');
|
||||||
|
|
||||||
beforeEach(function(){
|
beforeEach(function(){
|
||||||
require(root + 'jspsych.js');
|
require(root + 'jspsych.js');
|
@ -1,5 +1,5 @@
|
|||||||
const root = '../';
|
const root = '../../';
|
||||||
const utils = require('./testing-utils.js');
|
const utils = require('../testing-utils.js');
|
||||||
|
|
||||||
beforeEach(function(){
|
beforeEach(function(){
|
||||||
require(root + 'jspsych.js');
|
require(root + 'jspsych.js');
|
@ -1,5 +1,5 @@
|
|||||||
const root = '../';
|
const root = '../../';
|
||||||
const utils = require('./testing-utils.js');
|
const utils = require('../testing-utils.js');
|
||||||
|
|
||||||
beforeEach(function(){
|
beforeEach(function(){
|
||||||
require(root + 'jspsych.js');
|
require(root + 'jspsych.js');
|
Loading…
Reference in New Issue
Block a user