common/js/src/messaging/message-channel-pair-unittest.js
/**
 * Adds a listener that aborts the test when an unexpected message is received
 * (i.e., technically, when the message channel's default service is triggered).
 * @param {!goog.messaging.AbstractChannel} messageChannel
 */
Adds a listener that aborts the test when an unexpected message is received
.
@param {!goog.messaging.AbstractChannel} messageChannel
Adds a listener that aborts the test when an unexpected message is received . @param { !goog . messaging . AbstractChannel } messageChannel
function failWhenReceivedUnexpectedMessage(messageChannel) {
  messageChannel.registerDefaultService((payload) => {
    fail(`Unexpected message received: ${payload}`);
  });
}
function failWhenReceivedUnexpectedMessage ( messageChannel ) { messageChannel . registerDefaultService ( ( payload ) => { fail ( ` ${ payload } ` ) ; } ) ; }
Adds a listener that aborts the test when an unexpected message is received
 (i.e., technically, when the message channel's default service is triggered).
Adds a listener that aborts the test when an unexpected message is received ( i . e . technically when the message channel ' s default service is triggered ) .