Commit graph

10 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
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
Andrew Sliwinski
6ee8959100 Improve integration test coverage 2017-01-05 16:58:31 -05:00
Andrew Sliwinski
7d5820585b Resolve lint issues 2016-12-23 21:31:00 -05:00
Andrew Sliwinski
dfc6614a5b Build out integration test SB2 files 2016-12-23 21:08:13 -05:00