mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-23 14:32:59 -05:00
0fcc248ac1
The tests run using TinyWorker, which emulates web workers on Node. There are quite a few quirks in that situation due to the differences between Node and Webpack as well as the differences between TinyWorker and real Web Workers. The tests also exposed a few bugs in the dispatch system, which have now been fixed. Most notably, if a method called through the dispatch system throws an exception that exception will now be passed back to the caller. Previously the exception would escape the dispatch system and the caller would never hear any response at all.
8 lines
288 B
JavaScript
8 lines
288 B
JavaScript
const dispatch = require('../../src/dispatch/worker-dispatch');
|
|
const DispatchTestService = require('./dispatch-test-service');
|
|
|
|
dispatch.setService('RemoteDispatchTest', new DispatchTestService());
|
|
|
|
dispatch.waitForConnection.then(() => {
|
|
dispatch.call('test', 'onWorkerReady');
|
|
});
|