it('triggers `error(error)` when fragment responds with 50x', done => { nock('https://fragment') .get('/') .reply(500); const fragment = new Fragment(getOptions(TAG)); fragment.on('error', error => { assert.ok(error); done(); }); fragment.fetch(REQUEST); });
describe('\'auctions\' service', () => { it('registered the service', () => { const service = app.service('auctions'); assert.ok(service, 'Registered the service'); }); });
constructor(pocket, config) { super(pocket, config); const { url, dbName } = config; assert.ok(url, "Mongodb url should be provided (cfg.url)"); assert.ok(dbName, "Mongodb database name should be provided (cfg.dbName)"); this.url = url; this.dbName = dbName; if (!/^mongodb:\/\//.test(this.url)) { this.url = "mongodb://" + this.url; } let deferred = Q.defer(); this.client = new MongoClient(this.url, { useNewUrlParser: true }); this.client.connect((err, client) => { assert.equal(null, err); logger.log(`Connection established to ${this.url}`); this.db = client.db(dbName); deferred.resolve(true); }); this.initialization = deferred.promise; }
describe('\'recipes\' service', () => { it('registered the service', () => { const service = app.service('recipes'); assert.ok(service, 'Registered the service'); }); });
describe('\'users\' service', () => { it('registered the service', () => { const service = app.service('users'); assert.ok(service, 'Registered the service'); }); });
describe('\'users\' service', () => { it('registered the service', () => { const service = app.service('users'); assert.ok(service, 'Registered the service'); }); });