34 Commits
Author SHA1 Message Date
Thomas Weber 7387fa0883 Replace tap with node:test (#393) 2026-10-18 14:43:49 -05:00
Thomas Weber 6abc33d787 Remove immutable.js (#329)
Why:
* We use immutable.js 3.8.2 which is ancient and not getting updates
* immutable.js adds 55KB to the bundle, of which we use almost nothing
* immutable.js's treatment of 0 and -0 is nonsensical and would require weird workarounds like https://github.com/TurboWarp/scratch-vm/pull/320
* We don't benefit from the whole immutability thing

What we're doing instead:
* We have our own MonitorState and MonitorRecord classes
* We track dirty-ness at modification time instead of equality checking every tick
* scratch-gui and packager can continue to think we use immutable.js without causing issues in either direction
  * our objects have enough stubs that immutable.js-expecting consumers are ok
  * when receiving an object, we check if it looks like an immutable.js one and ask for the plain JS version so that works okay too
2026-01-09 22:30:18 -06:00
Muffin 81a0382e0f merge-upstream: initial merge of upstream/develop
installs & compiles but has test errors

aside from expected merge conflicts, notable changes from upstream:
 - removed husky, commitlint, etc.
 - removed semantic-release etc.
2023-12-22 17:25:21 -06:00
GarboMuffin 354e9411a5 Fix ESLint warning in engine_runtime.js
We used to add some more tests to this file, then we moved them
to a separate file, which is probably when this newline was introduced
2023-02-11 16:00:16 -06:00
Thomas Weber 339cdd4453 Move TW runtime tests to separate file, revert unnecessary changes 2022-05-28 19:13:16 -05:00
Thomas Weber 27699bb755 Re-enable another disabled cloud variable limit test
This should have been re-enabled a while ago when the limit was made configurable
2022-05-28 18:54:38 -05:00
Thomas Weber 27291b1c1f Make sure custom stage size is a round number and at least 1 2022-05-28 18:17:59 -05:00
Thomas Weber 25e91e735c Preserve monitor position relative to center of stage when resizing stage 2022-03-12 20:36:37 -06:00
Thomas Weber 41eceef19b Refactor frame loop logic and make "0 FPS" use requestAnimationFrame instead of setInterval 2021-12-13 16:22:16 -06:00
Thomas Weber 8b63a8115d Disable another intentionally broken test 2021-08-03 16:31:11 -05:00
Thomas Weber d3cd3d8109 tests: Test runtime.setInterpolation
This tests the interpolation setter itself. It does not test the interpolation.
2021-03-26 20:03:30 -05:00
Thomas Weber 8c4c46b871 test: Add a test for runtime debug mode 2021-03-26 19:54:36 -05:00
Thomas Weber eb140a2493 Add Runtime.stageWidth, Runtime.stageHeight 2021-01-30 20:23:31 -06:00
Thomas Weber 6f5917aadd Write some more tests 2021-01-12 12:35:45 -06:00
Eric Rosenbaum 45c95f3370 Move test 2020-06-23 17:13:11 -04:00
Karishma Chadha 85843e5d6f Fix cloud variable limit 2019-01-07 11:12:47 -05:00
Karishma Chadhaandpaulkaplan 6420cc8831 Update test/unit/engine_runtime.js
Co-Authored-By: paulkaplan <pkaplan@media.mit.edu>
2018-12-05 09:01:35 -05:00
Paul Kaplan 6bd2307c99 Clear the pen layer when runtime dispose happens. 2018-12-04 16:43:31 -05:00
Paul Kaplan 421aac6340 Ensure setCompatibilityMode continues to restart if previously started.
This was previous behavior, but the previous commit which prevents restarts based on _steppingInterval truthiness broke it because clearInterval does not modify the value of _steppingInterval
2018-11-28 08:47:51 -05:00
Paul Kaplan 4378603d36 Prevent the runtime from spawning new stepping intervals 2018-11-28 08:34:22 -05:00
Paul Kaplan 0c38c3cffe Force exiting after tests finish 2018-11-27 16:06:56 -05:00
Paul Kaplan cc4751228e Emit a RUNTIME_STARTED event to track if the vm has been started 2018-11-27 11:37:01 -05:00
Karishma Chadha ffef2e92fc Fix up docs and incorrect initialization of cloud data manager functions. Add 'spec' unit tests that the cloud data manager functions are actually functions. 2018-10-31 19:20:13 -04:00
Karishma Chadha 1df6743a5f Refactor cloud data manager to break out cloud data limit check vs. limit update. 2018-10-31 13:40:05 -04:00
Karishma Chadha a6de046dda Add unit and integration tests for the new functionality. 2018-10-30 18:54:25 -04:00
Katie Broida 6ef600dc2c Add runtime event for when the project is loaded (#1669) 2018-10-30 15:26:22 -04:00
Christopher Willis-Ford 2a13697621 Add tests for getLabelForOpcode 2018-09-12 17:23:01 -04:00
DD Liu 875eba568b fix file name in test 2017-05-30 10:24:09 -04:00
DD Liu 809760b954 Merge branch 'develop' into immutableState 2017-05-26 13:50:50 -04:00
DD Liu 1902848ea4 Switch to ordered maps of monitor records for monitor state 2017-05-24 15:42:29 -04:00
DD Liu 48c51ab2ec switch to nested immutables state 2017-05-19 17:28:00 -04:00
DD Liu 9645a513b1 Only send monitor update on change 2017-05-19 12:28:05 -04:00
Ray Schamp bafdf8d9f2 Use ES6 linting rules in the project root
Update all tests for `no-var` and `prefer-arrow-callback` (using `--fix`)
2017-04-24 15:37:58 -04:00
Andrew Sliwinski 8ca6944292 Add unit tests for all utility modules. Re GH-103 2016-10-03 16:34:57 -04:00