Commit graph

9 commits

Author SHA1 Message Date
Christopher Willis-Ford
840ffb5df0 test: don't use process.exit to end tests
Newer versions of `tap` run more asynchronously, so sometimes using `process.nextTick(process.exit)`
to end a test would prevent the test from completing correctly. Removing all instances of
`process.nextTick(process.exit)` put tests into three categories:
* the test still worked correctly -- no fixup needed.
* the test would hang because the VM's `_steppingInterval` was keeping
  Node alive. These tests call a new `quit()` method which ends the
  stepping interval.
* the `load-extensions` test needed special attention because the "Video
  Sensing" extension starts its own loop using `setTimeout`. I added a
  `_stopLoop()` method on the extension and directly call that from the
  test. I'm not completely happy with this solution but anything more
  general would likely require a change to the extension spec, so I'm
  leaving that as a followup task.
2022-06-07 11:44:06 -07:00
Karishma Chadha
6c2838e8f4 Renaming file reading/extracting functions in tests. 2018-04-05 13:46:07 -04:00
Karishma Chadha
1511fa79e3 Update tests to allow parsing whole .sb2s 2018-03-25 19:08:52 -04:00
Karishma Chadha
1d4acde7dc Fixing unit/integration tests. 2017-11-13 14:25:12 -05:00
Christopher Willis-Ford
cd1c72c7cc Convert attachTestStorage to makeTestStorage
Rather than assuming that the storage instance will be attached to a VM,
just return it. Callers may attach it to a `VM` or (in the case of
`import_sb2.js`) to a `Runtime`.
2017-06-12 12:34:20 -07: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
Paul Kaplan
f161640876 Update tests 2017-04-18 11:55:38 -04:00
Christopher Willis-Ford
e4fd9d57a2 Fix tests involving scratch-storage
- Attach the storage module to the VM for tests which load projects or
  other assets.
- Move `import_sb2.js` from `test/unit/ into `test/integration` since it
  now depends heavily on `scratch-storage`.
- Skip loading costumes when there is no renderer.
2017-03-09 15:50:43 -08:00
Christopher Willis-Ford
3b3daf8aca Add hat execution order test 2017-02-14 16:33:42 -08:00