-
Notifications
You must be signed in to change notification settings - Fork 5
/
index.js
48 lines (40 loc) · 1.2 KB
/
index.js
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
var fs = require('fs')
, path = require('path')
, mixin = fs.readFileSync(path.join(__dirname, 'lib/functional_mixin.js'))
, mixinLoader = fs.readFileSync(path.join(__dirname, 'lib/mixin_loader.js'))
;
module.exports =
{
name: 'buster-functional',
create: function (options)
{
var instance = Object.create(this);
instance.options = options || {};
// client side timeout, provided in seconds, default 60 seconds
instance.options.timeout = instance.options.timeout ? instance.options.timeout*1000 : 60000;
return instance;
},
configure: function(conf)
{
conf.on('load:framework', function(rs)
{
// add mixin
rs.addResource({
path: '/buster/functional_mixin.js',
// and add options
content:
[
mixin.toString(),
mixinLoader.toString().replace(/(\}\)\(buster)(\);)/, '$1, '+JSON.stringify(this.options)+'$2')
].join('\n')
});
rs.loadPath.append('/buster/functional_mixin.js');
}.bind(this));
},
testRun: function(testRunner)
{
// increase timeout on the server side,
// to allow for network hiccups
testRunner.timeout = this.options.timeout + 30000;
}
};