-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
46 lines (40 loc) · 1.42 KB
/
index.js
File metadata and controls
46 lines (40 loc) · 1.42 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
if (typeof include === 'undefined') {
throw new Error('<atma-utest> should be loaded by the `atma` package.');
}
let uri = new net.Uri(include.url);
module.exports = {
register(rootConfig) {
let options = rootConfig.atma && rootConfig.atma.settings && rootConfig.atma.settings['atma-utest'] || {};
let includeConfig = Object.assign({ amd: true }, options.include || {});
include.cfg(includeConfig);
rootConfig.$extend({
actions: {
test: getPath('/utest.node.js'),
act: getPath('/utest.node.js'),
},
server: {
subapps: {
'utest': getPath('env/HttpTestApplication.js')
},
websockets: {
'/node': getPath('/utest.server.js'),
'/utest-browser': function(socket) {
socket.emit('server:utest:handshake', function(info) {
let agent = info.userAgent.browser;
let msg = agent.name + ' ' + agent.version;
logger.log(
'uTest Browser connected:', msg.green.bold
);
})
}
}
}
});
}
};
function getPath(path) {
return uri
.combine('lib/')
.combine(path)
.toString();
}