Skip to content

Commit

Permalink
Update test
Browse files Browse the repository at this point in the history
  • Loading branch information
codenirvana committed May 6, 2024
1 parent 68f7b2a commit 601a47c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion lib/bridge.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ const Flatted = require('flatted'),
// boot code starts hereafter
__uvm_setTimeout = setTimeout;
try { ${bootCode}; } catch (error) {
try {
${bootCode};
} catch (error) {
__uvm_setTimeout(() => { throw error; }, 0);
}
Expand Down
4 changes: 2 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class UniversalVM extends EventEmitter {
* });
*/
static spawn (options, callback) {
const uvm = new UniversalVM(options, callback);
const uvm = new UniversalVM();

// connect with the bridge
uvm.connect(options, callback);
Expand Down Expand Up @@ -114,7 +114,7 @@ class UniversalVM extends EventEmitter {
catch (e) { } // eslint-disable-line no-empty
}

isFunction(callback) && callback.call(this, err, this);
isFunction(callback) && callback(err, this);
};

// bail out if bridge is connected
Expand Down
2 changes: 1 addition & 1 deletion test/unit/browser/missing-api.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
it('should error out if required browser APIs are missing', function (done) {
uvm.spawn({}, function (err) {
expect(err).to.be.an('error').that.has.property('message',
'uvm: unable to setup communication bridge, missing required APIs');
'uvm: unable to spawn worker.\nMissing required APIs');
done();
});
});
Expand Down

0 comments on commit 601a47c

Please sign in to comment.