1 |
|
2 | ;
|
3 |
|
4 | const Crawler = require('../lib/crawler');
|
5 | const expect = require('chai').expect;
|
6 | const given = require('mocha-testdata');
|
7 |
|
8 | describe('Unsupported function test', function() {
|
9 | given.async('onDrain','preRequest','cache')
|
10 | .it('should throw exception when using unsupported options', function(done,key) {
|
11 | const opt = {
|
12 | maxConnections: 10
|
13 | };
|
14 |
|
15 | opt[key] = {};
|
16 | expect(function(){Crawler(opt);}).to.throw(Error);
|
17 | done();
|
18 | });
|
19 | });
|