}) .then(_shell.exec.restore()) .should.be.fulfilled; }); result.should.equal('SPAWN: tupelo honey baby'); }) .should.be.fulfilled; }); child.spawn.restore(); const shell = new Shell(); sinon.stub(child, 'spawn').callsFake(fakeSpawn); return shell.sh(['van', 'the', 'man'], {detached: true}).should.be.fulfilled .then(child.spawn.restore()); }); }; }); return shell.sh(['van', 'the', 'man'], {mode: 'attach'}).should.be.fulfilled .then(child.spawn.restore()) .then(() => { }; }); return shell.sh(['van', 'the', 'man'], {mode: 'attach'}).should.be.fulfilled .then(child.spawn.restore()) .then(() => {
it('can disable simulator', function (done) { ourBoard = new Cyton({ verbose: true, simulate: true }); ourBoard.simulatorDisable().should.be.fulfilled.and.notify(done); });
describe('Flow Timeout Not Exeeded', function() { before(function() { runResult = flowa.run({}, {timeout: sample.hints.flowExecutionTime + 1}); // To (unhandled promise rejection) prevent warnings runResult.catch(noop); clock.tick(sample.hints.flowExecutionTime); }); it('Should be resolved', function() { return expect(runResult).to.be.fulfilled; }); });
it('should return an empty object when rules are empty', (done) => { const rules = {}; const params = {}; expect(whitelister(rules, params)).to.be.fulfilled .then((response) => { expect(response).to.be.an('object'); expect(Object.keys(response)).to.have.lengthOf(0); done(); }); });
it('leaves non JSON responses as is', function () { scope.reply(200, 'Hello World!', { 'Content-Type': 'text/plain' }); return http.request({path: 'test', acceptedType: 'text/plain'}).should.be.fulfilled .then( resp => resp.should.be.a('string').that.is.equal('Hello World!') ) });
it("should work applying the 'eventDistance' sort parameter", function (done) { // Set timeout this.timeout(10000); var es = new EventSearch(); es.search({ "lat": 40.710803, "lng": -73.964040, "distance": 100, "accessToken": accessToken, "sort": "eventDistance" }).should.be.fulfilled.and.notify(done); });
it('decodes JSON repsonses', function () { scope.reply(200, {'status': 'success'}, { 'Content-Type': 'application/json' }); return http.request({path: 'test'}).should.be.fulfilled .then( resp => resp.should.be.an('object').that.have.property('status') ) });
it('can enable simulator after constructor', function (done) { ourBoard = new Cyton({ verbose: true }); ourBoard.simulatorEnable().should.be.fulfilled.and.notify(done); });
describe('Task Flow Timeout Not Exeeded', function() { before(function() { runResult = flowa.run({}, {taskTimeout: sample.hints.taskExecutionTime + 1}); // To (unhandled promise rejection) prevent warnings runResult.catch(noop); clock.tick(sample.hints.flowExecutionTime); }); it('Should be resolved', function() { return expect(runResult).to.be.fulfilled; }); });
it("should return a list of events for a popular coordinate (Brooklyn, NY)", function (done) { // Set timeout this.timeout(10000); var es = new EventSearch(); es.search({ "lat": 40.710803, "lng": -73.964040, "distance": 100, "accessToken": accessToken }).should.be.fulfilled.and.notify(done); });
it("should work applying the 'venueDistance' sort parameter", function (done) { // Set timeout this.timeout(10000); var es = new EventSearch(); es.search({ "lat": 40.710803, "lng": -73.964040, "distance": 100, "accessToken": accessToken, "sort": "venueDistance" }).should.be.fulfilled.and.notify(done); });
it('should return an empty object when params are empty', (done) => { const rules = { name: 'string', }; const params = {}; expect(whitelister(rules, params)).to.be.fulfilled .then((response) => { expect(response).to.be.an('object'); expect(Object.keys(response)).to.have.lengthOf(0); done(); }); });
it("should work having place search categories", function (done) { // Set timeout this.timeout(10000); var es = new EventSearch(); es.search({ "lat": 40.710803, "lng": -73.964040, "distance": 100, "accessToken": accessToken, "sort": "distance", "categories": ["ARTS_ENTERTAINMENT", "EDUCATION"] }).should.be.fulfilled.and.notify(done); });