This repository was archived by the owner on Sep 21, 2022. It is now read-only.
Repository navigation
Expand file tree
/
Copy pathconfig.test.js
More file actions
91 lines (77 loc) · 2.75 KB
/
Copy pathconfig.test.js
File metadata and controls
91 lines (77 loc) · 2.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
'use strict';
var Config = require('../lib/config'),
GeminiError = require('../lib/errors/gemini-error');
describe('config', function() {
it('should require root url', function() {
(function() {
return new Config('/', [
'gridUrl: http://example.com'
].join('\n'));
}.must.throw(GeminiError));
});
it('should require grid url is there are non-phantomjs browsers', function() {
(function() {
return new Config('/', [
'rootUrl: http://example.com',
'browsers:',
' phantomjs: phantomjs',
' non-phantomjs: non-phantomjs'
].join('\n'));
}.must.throw(GeminiError));
});
it('should not require grid url if there are only phantomjs browser', function() {
(function() {
return new Config('/', [
'rootUrl: http://example.com',
'browsers:',
' phantomjs: phantomjs'
].join('\n'));
}.must.not.throw());
});
describe('capabilities', function() {
it('should be copied as is', function() {
var config = new Config('/', [
'rootUrl: http://example.com',
'gridUrl: http://example.com',
'capabilities:',
' option: value',
' option2: other value'
].join('\n'));
config.capabilities.must.eql({
option: 'value',
option2: 'other value'
});
});
function shouldNotAllowCapability(name) {
it('should not allow set `' + name + '` capability', function() {
(function() {
return new Config('/', [
'rootUrl: http://example.com',
'gridUrl: http://example.com',
'capabilities:',
' ' + name + ': value'
].join('\n'));
}.must.throw());
});
}
shouldNotAllowCapability('takesScreenshot');
});
describe('http', function() {
it('should be passed only timeout, retries and retryDelay options', function() {
var config = new Config('/', [
'rootUrl: http://example.com',
'gridUrl: http://example.com',
'http:',
' timeout: 1000',
' retries: 5',
' retryDelay: 25',
' invalid: ignored'
].join('\n'));
config.http.must.eql({
timeout: 1000,
retries: 5,
retryDelay: 25
});
});
});
});