Skip to content

Commit

Permalink
Test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
jazz-soft committed Aug 26, 2019
1 parent c349e58 commit f2ddf23
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions javascript/JZZ.js
Original file line number Diff line number Diff line change
Expand Up @@ -631,13 +631,13 @@
this._pause();
document.addEventListener('jazz-midi-msg', eventHandle);
try { document.dispatchEvent(new Event('jazz-midi')); } catch (err) {}
setTimeout(function() { if (!inst) self._crash(); }, 0);
_schedule(function() { if (!inst) self._crash(); });
}

function _zeroBreak() {
this._pause();
var self = this;
setTimeout(function() { self._crash(); }, 0);
_schedule(function() { self._crash(); });
}

function _filterEngines(opt) {
Expand Down Expand Up @@ -979,12 +979,12 @@
_engine._watch = function() {
_engine._access.onstatechange = function() {
watcher = true;
setTimeout(function() {
_schedule(function() {
if (watcher) {
_engine._refresh();
watcher = false;
}
}, 0);
});
};
};
_engine._unwatch = function() {
Expand Down Expand Up @@ -1016,9 +1016,9 @@
_engine._refresh = function(client) {
_engine.refreshClients.push(client);
client._pause();
setTimeout(function() {
_schedule(function() {
document.dispatchEvent(new CustomEvent('jazz-midi', { detail: ['refresh'] }));
}, 0);
});
};
function _closeAll() {
for (var i = 0; i < this.clients.length; i++) this._close(this.clients[i]);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
"devDependencies": {
"coveralls": "^3.0.6",
"eslint": "^6.2.1",
"eslint": "^6.2.2",
"grunt": "^1.0.4",
"grunt-contrib-jshint": "^2.1.0",
"grunt-contrib-uglify": "^4.0.1",
Expand Down
4 changes: 2 additions & 2 deletions test/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ module.exports = function(JZZ, PARAMS, DRIVER) {
JZZ.lib.registerMidiOut('Widget MIDI-Out', widget2); // should ignore second call
port2 = engine.openMidiOut('Widget MIDI-Out');
port2.connect(port1);
port2.and(function() { assert.equal(this.connected(), 1); this.noteOn(0, 60); });
port2.and(function() { assert.equal(this.connected(), 1); this.send([]); this.noteOn(0, 60); });
});
},

Expand Down Expand Up @@ -158,7 +158,7 @@ module.exports = function(JZZ, PARAMS, DRIVER) {
};
port1 = engine.openMidiOut(name1);
port2 = engine.openMidiOut(name2);
port2.and(function() { this.noteOn(0, 60, 127); });
port2.and(function() { this.send([]); this.noteOn(0, 60, 127); });
});
},

Expand Down

0 comments on commit f2ddf23

Please sign in to comment.