Verify that depth is set when you crawl #2806 (#2807)

This commit is contained in:
Peter Hedenskog 2019-11-29 10:10:03 +01:00 committed by GitHub
parent 3d99e82f51
commit caddb34d65
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -4,6 +4,7 @@ const path = require('path');
const merge = require('lodash.merge');
const log = require('intel').getLogger('sitespeedio.plugin.crawler');
const Crawler = require('simplecrawler');
const throwIfMissing = require('../../support/util').throwIfMissing;
const defaultOptions = {
depth: 3
@ -11,6 +12,7 @@ const defaultOptions = {
module.exports = {
open(context, options) {
throwIfMissing(options.crawler, ['depth'], 'crawler');
this.options = merge({}, defaultOptions, options.crawler);
this.make = context.messageMaker('crawler').make;
this.basicAuth = options.browsertime