Commit Graph

9 Commits

Author SHA1 Message Date
bjoluc
ff2827d8c9 Move test utility functions into @jspsych/test-utils 2021-09-28 20:04:19 +02:00
Josh de Leeuw
ddc3436b2f add test case for #2105 2021-09-01 15:26:40 -04:00
bjoluc
a06b07ddc9 Get rid of reset and createKeyboardEventListeners, instantiate API objects directly in pluginapi tests 2021-08-22 21:59:12 +02:00
bjoluc
39e84a02e2 Remove keycode functionality 2021-08-22 16:25:24 +02:00
bjoluc
4fcb2f7e56 Refactor KeyboardListenerAPI 2021-08-17 19:13:30 +02:00
bjoluc
743ad44e84 Replace ALL_KEYS and NO_KEYS with strings
`"ALL_KEYS"` is now used instead of `jsPsych.ALL_KEYS` and `"NO_KEYS"`
instead of `jsPsych.NO_KEYS`
2021-08-17 17:07:23 +02:00
bjoluc
c119650471 Move experiment execution into jsPsych.run()
The `run()` method takes a timeline and returns a promise that is
resolved when the experiment finishes.
Hence, jsPsych can now be initialized without starting an experiment.
This re-enables usage of `jsPsych.timelineVariable()` in timeline
definitions and repairs exclusion checks and extension loading.
2021-07-19 17:10:37 +02:00
bjoluc
8cfbba526a Use classes to avoid global state
Instead of a global `jsPsych` object, there is a `JsPsych` class now
which can be instantiated with the parameters that were previously
accepted by `jsPsych.init`. Upon instantiation, the `JsPsych` class also
instantiates classes for stateful modules (`jsPsych.data` and
`jsPsych.pluginAPI`) and passes relevant `JsPsych` instance information
to them. Plugins are expected to be classes now that are instantiated
for each trial and receive the `JsPsych` instance as their only
constructor argument.
2021-07-12 18:15:37 +02:00
bjoluc
91e7b1e3ff Migrate to TypeScript 2021-07-06 17:55:42 +02:00