This commit is contained in:
William Bartholomew 2016-11-15 17:19:34 -08:00
Родитель 4d71502292
Коммит 2e0d059bfe
2 изменённых файлов: 6 добавлений и 6 удалений

Просмотреть файл

@ -28,7 +28,7 @@ class Crawler {
if (typeof result.then === 'function') {
result.then(
result => { self.logger.verbose(`Promise Function Success: ${thing.name}`); },
error => { self.logger.error(`Promise Function Error: ${thing.name}`, error); });
error => { self.logger.verbose(`Promise Function Error: ${thing.name}`, error); });
} else {
self.logger.verbose(`Promise Function Exit: ${thing.name}: ${result}`);
}
@ -38,7 +38,7 @@ class Crawler {
this.logger.verbose(`Promise Enter`);
thing.then(
result => { this.logger.verbose(`Promise Success: ${result}`); },
error => { this.logger.error(`Promise Error: ${result}`, error); });
error => { this.logger.verbose(`Promise Error: ${result}`, error); });
return thing;
}
}

Просмотреть файл

@ -824,11 +824,11 @@ describe('Crawler whole meal deal', () => {
return Q.try(() => {
return crawler.start('test');
}).then(() => {
expect(crawler.priorityQueue.pop.callCount).to.be.equal(1);
expect(crawler.normalQueue.pop.callCount).to.be.equal(1);
expect(crawler.priorityQueue.pop.callCount).to.be.equal(1, 'priority call count');
expect(crawler.normalQueue.pop.callCount).to.be.equal(1, 'normal call count');
const lock = crawler.locker.lock;
expect(lock.callCount).to.be.equal(1);
expect(lock.callCount).to.be.equal(1, 'lock call count');
expect(lock.getCall(0).args[0]).to.be.equal('http://test.com/users/user1');
const etag = crawler.store.etag;
@ -1045,7 +1045,7 @@ describe('Crawler whole meal deal', () => {
expect(newRequest.type).to.be.equal('user');
expect(newRequest.attemptCount).to.be.equal(1);
expect(crawler.logger.error.callCount).to.be.equal(2);
expect(crawler.logger.error.callCount).to.be.equal(1);
const error = crawler.logger.error.getCall(0).args[0];
expect(error instanceof Error).to.be.true;
});