Commit Graph

53 Commits

Author SHA1 Message Date
jade
0b78155290 remove unnecessary helper function 2025-01-10 13:23:01 -07:00
jade
c8bda3c35b reactivate old test, remove deprecated toThrowError() calls 2025-01-10 01:52:45 -07:00
jade
ad1d854f43 rework tests to use displayElement, remove DOM clearing per test 2025-01-10 01:02:58 -07:00
Josh de Leeuw
313edc2af5 adjust tests to work with cleanup 2024-07-11 17:17:55 -04:00
vzhang03
593d4ce7bf Updating old tests to use new plugin syntax and requirements 2024-06-21 15:03:10 -04:00
Josh de Leeuw
7b1ae24f4e add abortTimelineByName() 2023-10-30 13:01:55 -04:00
bjoluc
9cac68a140 Merge branch 'main' into core-rewrite 2023-07-13 17:38:45 +02:00
Josh de Leeuw
545ecbaa76 update test case 2023-05-17 15:42:39 -04:00
Josh de Leeuw
7dd439fdcc fix test case, need to pressKey because not simulation 2023-05-17 12:10:43 -04:00
Josh de Leeuw
e0026a3f87 add failing test for #2859 2023-05-17 11:38:05 -04:00
Josh de Leeuw
5f2b049763 add failing test for #2862 2023-05-17 10:47:54 -04:00
Josh de Leeuw
b6d4b18278 add test case for #2912 2023-05-17 10:30:56 -04:00
Josh de Leeuw
d0a6839ac2 add a test for #2911 2023-05-16 17:45:23 -04:00
Josh de Leeuw
a72a455fb4 add test case for #3008 2023-05-16 12:22:25 -04:00
Josh de Leeuw
1324361835 Fix defaults for COMPLEX parameter types 2023-03-06 10:09:24 -05:00
bjoluc
76e7508024 Upgrade Jest to v29 and replace ts-jest with @sucrase/jest-plugin 2022-11-17 21:28:44 +01:00
bjoluc
8318d380c1 Merge branch 'main' into core-rewrite 2022-11-09 15:13:58 +01:00
bjoluc
61ec10779c Run on_timeline_start and on_timeline_finish only once per timeline 2022-11-09 11:12:38 +01:00
bjoluc
f9f99b5c32 Fix skipped tests 2022-11-09 10:10:27 +01:00
bjoluc
2092d12a60 Rename jsPsych.end... functions to jsPsych.abort... and implement abortCurrentTimeline 2022-11-08 22:27:32 +01:00
bjoluc
677333e6fa Add missing awaits in functions-as-parameters.test.ts 2022-10-28 20:10:38 +02:00
bjoluc
f211f6bc53 Enhance progress bar implementation 2022-10-14 20:59:48 +02:00
bjoluc
45a218291b Extract ProgressBar class 2022-10-12 17:43:15 +02:00
bjoluc
06d87d0c81 Update more core test files 2022-10-12 11:01:24 +02:00
bjoluc
bdaff4aefc Adapt implementation to timelines.test.ts 2022-10-11 21:49:10 +02:00
bjoluc
d7f29da8f5 Adapt Timeline tests and implementation according to timeline-variables.test.ts 2022-10-10 20:00:24 +02:00
bjoluc
5b50a92150 Evaluate complex (array) parameter functions 2022-10-10 13:43:05 +02:00
bjoluc
035d2aa1dd Implement global event handlers 2022-10-06 21:59:20 +02:00
bjoluc
deaa602c56 Fix some old core tests and implement endExperiment() 2022-09-30 17:36:35 +02:00
Josh de Leeuw
5ddd28cb83 remove .only test 2022-07-14 11:15:25 -04:00
Josh de Leeuw
ac1c2c5477 add test case for fixed-repetitions method (verify #2708) 2022-07-14 11:00:39 -04:00
Josh de Leeuw
ce03ed99d5 skip test that throws an error 2022-07-01 10:21:28 -04:00
Josh de Leeuw
13be1ef4ef timelineVariable() throws an error when the variable doesn't exist (fixes #2680) 2022-06-24 10:01:31 -04:00
Josh de Leeuw
c10f21e442 fix for #2497 2022-03-12 18:13:47 -05:00
Josh de Leeuw
d9b92da1ac fix case where simulation_options is a function that evals to a string 2021-12-07 14:40:22 -05:00
Josh de Leeuw
522aa2cdbf
Adding a simulation mode (#2287)
Implements simulation mode in the core library, supporting API features, and plugin support in most plugins.
2021-11-23 15:12:30 -05:00
bjoluc
ff2827d8c9 Move test utility functions into @jspsych/test-utils 2021-09-28 20:04:19 +02:00
bjoluc
338c1b62b6 Merge branch 'modularization' into modularization-es6-stuff 2021-09-15 11:53:19 +02:00
bjoluc
63acb56dac Re-enable tests that depend on plugins converted in #2078 2021-09-14 18:31:48 +02:00
Josh de Leeuw
12d675320f
Allow on_finish to return a Promise and delay the endExperiment message. (#2142)
* implement Promise handling for on_finish() experiment event. #2050 #1850

* add documentation
2021-09-10 13:40:56 -04:00
Becky Gilbert
db754538b7
Convert plugins to classes and update examples (#2078)
* modularize plugins: edit index.ts and example files (WIP)

* continue modularizing plugins: edit index.ts and example files (WIP)

* continue modularizing plugins: edit index.ts and example files (WIP)

* continue modularizing plugins and example files, make info static in plugin classes

* add preload flag to plugin info, fix a few parameterType values

* change preload flags in plugin info from audio/image/video strings to boolean

* convert more plugins and example files

* convert more plugins/examples, sync with webgazer branch plugins/examples (not working on this branch)

* remove preload flag from info, change to ParameterType, change to "ALL_KEYS"/"NO_KEYS", change KEY type to KEYS for array params

* remove descriptions from plugin info, fix some ALL_KEYS/NO_KEYS errors

* remove descriptions and add pretty names to plugin info

* remove/edit comments re ALL_KEYS/NO_KEYS and TS errors

* fix some preload plugin errors and convert example file (plugin still not working due to getAutoPreloadList)

* convert RDK plugin and example file

* convert preload plugin and example, add JsPsych getTimelineDescription method for auto-preloading (still not working for audio due to getAudioBuffer

* fix jsPsych getTimelineDescription method so that it does recursive search

* add image and video preloading to plugin examples

* Merge branch 'modularization' into modularization-plugins

* add tests for reconstruction

* fix timeline array getter method: add private timelineDescription var, set to timeline array in run(), rename getTimelineDescription to getTimeline

* changes in response to PR review: fix JsDoc comments, fix array: true in param info, change HTML string param types, add JsDoc author/file/see docs for all plugin classes, switch to @ts-expect-error. Thanks @bjoluc!

* fix JsDoc comments for plugin classes and preload trials parameter

* change preload type to boolean in ParameterInfo interface, and add `preload: false` to virtual-chinrest item_path image parameter

* All my tests except for preload plugin (will do that tomorrow)

* minor fixes to reconstruction tests

* Update preload plugin tests

* Finish test conversion

* switch to arrow functions to fix this keyword errors in plugins, add audio preloading into plugin example files, fix typos

* convert non-plugin example files (WIP, not tested)

* Fix allow_held_keys -> allow_held_key parameter in virtual-chinrest plugin

* Fix `keyboardListener` type in serial-reaction-time plugin

* type fixes for RDK, simplifying `correctOrNot()` function

* fixed ["ALL_KEYS"] => "ALL_KEYS" for iat plugins and tests

* Build jspsych packages before everything else

Dependent builds were previously failing due to missing type definitions

* Remove console.log from html-keyboard-response tests

I think I accidentially committed it.

* fix the delayed start to animation bug (#1885)

* round all RTs to nearest int (#2108)

* fixes and tests #1900 - IAT parameter problems

* finish converting/testing example files, add init settings, add audio preloading, fix errors

* fix progress-bar timeline to demo an example where auto-updating the progress bar works well

* Revert "round all RTs to nearest int (#2108)"

This reverts commit f53145d2e3.

* change how delayed timeline variables are implemented

* use static for generate_stimulus method so that it can be called on the vsl-grid-scene class

* fix external-html plugin and example (switch to arrow function for proper this context, fix incorrect parameter name)

* remove outdated TO DO comments

Co-authored-by: bjoluc <mail@bjoluc.de>
Co-authored-by: Josh de Leeuw <josh.deleeuw@gmail.com>
2021-09-08 09:44:53 -04:00
Josh de Leeuw
f4d04e5056
Merge pull request #2098 from bjoluc/preloading
Rework preloading in MediaAPI
2021-09-01 15:04:32 -04:00
Josh de Leeuw
a77052deb2 replace var where needed 2021-08-25 11:06:11 -04:00
Josh de Leeuw
266f756155 replace var where needed 2021-08-25 11:05:56 -04:00
Josh de Leeuw
5d060f6b96 rename getter methods, update docs 2021-08-23 13:11:32 -04:00
bjoluc
c30b6ad19a Rework preloading in MediaAPI
This drops support for the `registerPreload()` function and instead
infers preloading information on the fly in `getAutoPreloadList()`.
2021-08-22 00:11:17 +02:00
bjoluc
9c519853fe Use enum for parameter types and remove JsPsych.plugins
`const parameterType` is now `enum ParameterType` and can only be
accessed by importing it.
2021-08-17 17:19:25 +02:00
bjoluc
64541a451f Implement preload flag for plugin parameters
It defaults to `true` for parameters of type IMAGE, VIDEO, and AUDIO,
and is ignored for any other parameter type.
Example: Using `parameterType.IMAGE` for a parameter `param` in a
plugin named `my-plugin` is equivalent to calling
`jspsych.pluginAPI.registerPreload("my-plugin", "param", "image")`
before `jsPsych.run()`. Setting `preload: false` for the parameter would
disable this invocation.
2021-08-17 16:47:07 +02:00
bjoluc
56d6fd9d0b Make plugin info static
so it can be accessed before a plugin is instantiated
2021-08-12 17:25:26 +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