From b9a5ffde2fa7992b200bc5d233025c54f766a2fe Mon Sep 17 00:00:00 2001 From: Josh de Leeuw Date: Sun, 15 Jan 2017 15:43:00 -0500 Subject: [PATCH] organize tests --- tests/{ => jsPsych.data}/datacollection.test.js | 4 +++- tests/{ => jsPsych.data}/datacolumn.test.js | 4 +++- tests/{ => jsPsych.data}/datamodule.test.js | 7 +++++-- tests/{ => jsPsych.pluginAPI}/pluginapi.test.js | 4 +++- tests/{ => jsPsych.randomization}/randomziation.test.js | 5 ++++- ...sh-triallevel.test.js => on_finish-trial-level.test.js} | 0 tests/{ => plugins}/plugin-single-stim.test.js | 6 ++++-- 7 files changed, 22 insertions(+), 8 deletions(-) rename tests/{ => jsPsych.data}/datacollection.test.js (98%) rename tests/{ => jsPsych.data}/datacolumn.test.js (96%) rename tests/{ => jsPsych.data}/datamodule.test.js (98%) rename tests/{ => jsPsych.pluginAPI}/pluginapi.test.js (99%) rename tests/{ => jsPsych.randomization}/randomziation.test.js (90%) rename tests/{onfinish-triallevel.test.js => on_finish-trial-level.test.js} (100%) rename tests/{ => plugins}/plugin-single-stim.test.js (89%) diff --git a/tests/datacollection.test.js b/tests/jsPsych.data/datacollection.test.js similarity index 98% rename from tests/datacollection.test.js rename to tests/jsPsych.data/datacollection.test.js index cd741db0..d002d6e2 100644 --- a/tests/datacollection.test.js +++ b/tests/jsPsych.data/datacollection.test.js @@ -1,4 +1,6 @@ -require('../jspsych.js'); +const root = '../../'; + +require(root + 'jspsych.js'); var data = [ {rt: 100, filter: true}, diff --git a/tests/datacolumn.test.js b/tests/jsPsych.data/datacolumn.test.js similarity index 96% rename from tests/datacolumn.test.js rename to tests/jsPsych.data/datacolumn.test.js index 996fb183..3688c605 100644 --- a/tests/datacolumn.test.js +++ b/tests/jsPsych.data/datacolumn.test.js @@ -1,4 +1,6 @@ -require('../jspsych.js'); +const root = '../../'; + +require(root + 'jspsych.js'); var data = [ {rt: 100, filter: true}, diff --git a/tests/datamodule.test.js b/tests/jsPsych.data/datamodule.test.js similarity index 98% rename from tests/datamodule.test.js rename to tests/jsPsych.data/datamodule.test.js index f077569c..96639fda 100644 --- a/tests/datamodule.test.js +++ b/tests/jsPsych.data/datamodule.test.js @@ -1,5 +1,8 @@ -require('../jspsych.js'); -require('../plugins/jspsych-text.js'); +const root = '../../'; + +require(root + 'jspsych.js'); + +require(root + 'plugins/jspsych-text.js'); describe('Basic data recording', function(){ test('should be able to get rt after running experiment', function(){ diff --git a/tests/pluginapi.test.js b/tests/jsPsych.pluginAPI/pluginapi.test.js similarity index 99% rename from tests/pluginapi.test.js rename to tests/jsPsych.pluginAPI/pluginapi.test.js index b003496e..646da6e7 100644 --- a/tests/pluginapi.test.js +++ b/tests/jsPsych.pluginAPI/pluginapi.test.js @@ -1,4 +1,6 @@ -require('../jspsych.js'); +const root = '../../'; + +require(root + 'jspsych.js'); describe('#getKeyboardResponse', function(){ test('should execute a function after successful keypress', function(){ diff --git a/tests/randomziation.test.js b/tests/jsPsych.randomization/randomziation.test.js similarity index 90% rename from tests/randomziation.test.js rename to tests/jsPsych.randomization/randomziation.test.js index 7ae51a7a..35e1c51c 100644 --- a/tests/randomziation.test.js +++ b/tests/jsPsych.randomization/randomziation.test.js @@ -1,4 +1,7 @@ -require('../jspsych.js'); +const root = '../../'; + +require(root + 'jspsych.js'); + describe('#shuffle', function(){ test('should produce fixed order with mock RNG', function(){ diff --git a/tests/onfinish-triallevel.test.js b/tests/on_finish-trial-level.test.js similarity index 100% rename from tests/onfinish-triallevel.test.js rename to tests/on_finish-trial-level.test.js diff --git a/tests/plugin-single-stim.test.js b/tests/plugins/plugin-single-stim.test.js similarity index 89% rename from tests/plugin-single-stim.test.js rename to tests/plugins/plugin-single-stim.test.js index f25670f1..28034c2e 100644 --- a/tests/plugin-single-stim.test.js +++ b/tests/plugins/plugin-single-stim.test.js @@ -1,5 +1,7 @@ -require('../jspsych.js'); -require('../plugins/jspsych-single-stim.js'); +const root = '../../'; + +require(root + 'jspsych.js'); +require(root + 'plugins/jspsych-single-stim.js'); test('jsPsych should be in the window object', function(){ expect(typeof window.jsPsych).not.toBe('undefined');