relocate tests on core library

This commit is contained in:
Josh de Leeuw 2018-06-25 15:18:23 -04:00
parent 243c49dc74
commit c112f930c1
5 changed files with 22 additions and 41 deletions

View File

@ -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(){
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){
var key_data = null;
@ -32,9 +34,6 @@ describe('on_finish (trial)', 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){
var promise_data = {};
@ -67,8 +66,6 @@ describe('on_finish (trial)', function(){
describe('on_start (trial)', 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){
@ -95,8 +92,6 @@ describe('on_start (trial)', 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){
@ -128,8 +123,6 @@ describe('on_start (trial)', function(){
describe('on_trial_finish (experiment level)', 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){
@ -159,8 +152,6 @@ describe('on_trial_finish (experiment level)', 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){
@ -193,8 +184,6 @@ describe('on_trial_finish (experiment level)', function(){
describe('on_data_update', 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){
@ -224,8 +213,6 @@ describe('on_data_update', 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){
@ -258,8 +245,6 @@ describe('on_data_update', 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){
@ -295,8 +280,6 @@ describe('on_data_update', function(){
describe('on_trial_start', 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){
@ -326,8 +309,6 @@ describe('on_trial_start', function(){
});
test('should allow modification of the trial properties', function(){
require('../jspsych.js');
require('../plugins/jspsych-html-keyboard-response.js');
var trial = {
type: 'html-keyboard-response',

View File

@ -1,4 +1,4 @@
const root = '../';
const root = '../../';
require(root + 'jspsych.js');

View File

@ -1,5 +1,5 @@
const root = '../';
const utils = require('./testing-utils.js');
const root = '../../';
const utils = require('../testing-utils.js');
beforeEach(function(){
require(root + 'jspsych.js');

View File

@ -1,5 +1,5 @@
const root = '../';
const utils = require('./testing-utils.js');
const root = '../../';
const utils = require('../testing-utils.js');
beforeEach(function(){
require(root + 'jspsych.js');

View File

@ -1,5 +1,5 @@
const root = '../';
const utils = require('./testing-utils.js');
const root = '../../';
const utils = require('../testing-utils.js');
beforeEach(function(){
require(root + 'jspsych.js');