// set stop to job app.post(routes.stop, function(req, res) { crontab.status(req.body._id, true); res.end(); });
/** * Handles checking if the guild has been deleted, and if so, stops the collector with the reason 'guildDelete'. * @private * @param {Guild} guild The guild that was deleted * @returns {void} */ _handleGuildDeletion(guild) { if (this.channel.guild && guild.id === this.channel.guild.id) { this.stop('guildDelete'); } }
it('should stop service', async () => { const OpenWeatherService = proxyquire('../../../services/openweather/index', workingAxiosClear); const openWeatherService = OpenWeatherService(gladys, '35deac79-f295-4adf-8512-f2f48e1ea0f8'); await openWeatherService.stop(); });
x(url, ['a'])(function (err, arr) { var i = arr.length + 1; while (--i) { x(url, { title: 'title' })(function () { if (++total === arr.length) { timer.stop(); } }); } });
/** * Stopping all appenders */ stop() { return this.broker.Promise.all(this.appenders.map(appender => appender.stop())); }
describe("Test RedisDiscoverer 'discoverAllNodes' method", () => { it("should call collectOnlineNodes", async () => { const broker = new ServiceBroker({ logger: false, transporter: "Fake" }); const discoverer = new RedisDiscoverer(); discoverer.init(broker.registry); discoverer.collectOnlineNodes = jest.fn(() => Promise.resolve()); await discoverer.discoverAllNodes(); expect(discoverer.collectOnlineNodes).toBeCalledTimes(1); expect(discoverer.collectOnlineNodes).toBeCalledWith(); await discoverer.stop(); }); });
describe("Test Registry.init", () => { const broker = new ServiceBroker({ logger: false }); const registry = broker.registry; it("should call discoverer.init", async () => { registry.discoverer.init = jest.fn(); registry.init(); expect(registry.discoverer.init).toBeCalledTimes(1); await registry.stop(); }); });
test(`multiline is well supported (${effect})`, t => { const an = a[effect]('Lorem\nipsum\ndolor\nsit\namet').stop(); const frame = an.frame(); t.is(an.lines, 5); t.is(frame.split('\n').length, 5); });
it('should update the recording id when the name changes', async function() { const polly = new Polly('squawk'); expect(polly.recordingName).to.equal('squawk'); expect(polly.recordingId).to.contain('squawk'); polly.recordingName = 'chirp'; expect(polly.recordingName).to.equal('chirp'); expect(polly.recordingId).to.contain('chirp'); await polly.stop(); });
describe('#stop', () => { it('should return the correct default options when not specified'); it('#stop should return an object.', () => { const stopResult = compose.stop( ['string1', 'string2'], 'my_project', myOpts ); expect(stopResult).to.be.an('object'); }); });
it('should instantiate without throwing', async function() { await expect(async function() { const polly = new Polly('recording name'); await polly.stop(); }).to.not.throw(); });
it('can manually set the mode', async function() { const polly = new Polly('squawk'); expect(polly.mode).to.equal('replay'); polly.mode = 'record'; expect(polly.mode).to.equal('record'); await polly.stop(); });
it('should be able to change the recording name', async function() { const polly = new Polly('squawk'); expect(polly.recordingName).to.equal('squawk'); polly.recordingName = 'squawk squawk'; expect(polly.recordingName).to.equal('squawk squawk'); await polly.stop(); });
it('should stop service', async () => { const OpenWeatherService = proxyquire('../../../services/openweather/index', workingAxiosClear); const openWeatherService = OpenWeatherService(gladys, '35deac79-f295-4adf-8512-f2f48e1ea0f8'); await openWeatherService.stop(); });
it('should update the recording id when the name changes', async function() { const polly = new Polly('squawk'); expect(polly.recordingName).to.equal('squawk'); expect(polly.recordingId).to.contain('squawk'); polly.recordingName = 'chirp'; expect(polly.recordingName).to.equal('chirp'); expect(polly.recordingId).to.contain('chirp'); await polly.stop(); });