Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var PulseTestReceiver = function(credentials, mocha) {
var that = this;
this._connection = new taskcluster.PulseConnection(credentials);
this._listeners = null;
this._promisedMessages = null;
// **Note**, the functions below are mocha hooks. Ie. they are called by
// mocha, that is also the reason that `PulseTestReceiver` only works in the
// context of a mocha test. Note that we assume mocha is in "tdd" mode.
if (!mocha) {
mocha = require('mocha');
}
// Before all tests we ask the pulseConnection to connect, why not it offers
// slightly better performance, and we want tests to run fast
mocha.suiteSetup(function() {
return that._connection.connect();
});
setup: async ({cfg}) => {
return new taskcluster.PulseConnection(cfg.pulse);
},
},