/***
 * Copyright (c) 2016 - 2022 Alex Grant (@localnerve), LocalNerve LLC
 * Copyrights licensed under the BSD License. See the accompanying LICENSE file for terms.
 *
 * A simple mock of MessageChannel, purposed for this test suite.
 */
'use strict';

function MessageChannel () {
  var port1 = {};

  this.port1 = port1;
  this.port2 = {
    mockRespond: function (event) {
      if (port1.onmessage) {
        port1.onmessage(event);
      }
    }
  };
}

module.exports = MessageChannel;
