Skip to content

Commit

Permalink
More coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
jazz-soft committed Sep 5, 2019
1 parent 60c482a commit e0bcf79
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/engine3.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,20 @@ var WMT = require('web-midi-test');
WMT.sysex = false;
global.navigator = WMT;

global.document = {
handle: {},
addEventListener: function(name, handle) { this.handle[name] = handle; },
removeEventListener: function(name /*, handle*/) { delete this.handle[name]; },
};
window.dispatchEvent = function(evt) { if (document.handle[evt.name]) document.handle[evt.name](); };
window.webkitAudioContext = function() {
return {
resume: function() { this.state = 'running'; },
createOscillator: function() { return { connect: function() {}, noteOn: function() {}, noteOff: function() {} }; },
createGainNode: function() { return { connect: function() {}, gain: { setTargetAtTime: function() {} } }; }
};
};

var test = require('./tests.js')(JZZ, { engine: 'webmidi', sysex: true, degrade: true }, WMT);

describe('Engine: webmidi', function() {
Expand Down

0 comments on commit e0bcf79

Please sign in to comment.