This repository was archived by the owner on Sep 21, 2022. It is now read-only.
Repository navigation
Expand file tree
/
Copy pathstate.test.js
More file actions
58 lines (46 loc) · 2.09 KB
/
Copy pathstate.test.js
File metadata and controls
58 lines (46 loc) · 2.09 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
'use strict';
var State = require('../lib/state'),
Browser = require('../lib/browser');
describe('state', function() {
describe('shouldSkip()', function() {
function makeBrowser(capabilities) {
return new Browser({}, 'id', capabilities);
}
beforeEach(function() {
this.suite = {skipped: false};
this.state = new State(this.suite, 'state');
});
it('should not skip any browser if skipped=false', function() {
this.state.shouldSkip(makeBrowser({browserName: 'browser'})).must.be.false();
});
it('should skip any browser if skipped=true', function() {
this.suite.skipped = true;
this.state.shouldSkip(makeBrowser({browserName: 'browser'})).must.be.true();
});
it('should skip browser if its name and version matches skip list', function() {
this.suite.skipped = [
{browserName: 'browser', version: '1.0'}
];
this.state.shouldSkip(makeBrowser({browserName: 'browser', version: '1.0'})).must.be.true();
});
it('should not skip the browser if its name does not match skip list', function() {
this.suite.skipped = [
{browserName: 'browser', version: '1.0'}
];
this.state.shouldSkip(makeBrowser({browserName: 'other browser', version: '1.0'})).must.be.false();
});
it('should not skip browser if its version does not match skip list', function() {
this.suite.skipped = [
{browserName: 'browser', version: '1.0'}
];
this.state.shouldSkip(makeBrowser({browserName: 'browser', version: '1.1'})).must.be.false();
});
it('should skip any browser of a given name if version is not specified in skip list', function() {
this.suite.skipped = [
{browserName: 'browser'}
];
this.state.shouldSkip(makeBrowser({browserName: 'browser', version: '1.1'})).must.be.true();
});
});
//describe('the rest of state functionality');
});