-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path.mocharc.js
36 lines (34 loc) · 906 Bytes
/
.mocharc.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
'use strict';
function initCI() {
var http = require('http');
var url = require('url');
var req = http.request({
...url.parse(`${process.env.BASE_HABITICA_URI}/api/v3/user/auth/local/register`),
method: 'POST',
headers: {
'Content-Type': 'application/json'
}
}, (res) => {
res.setEncoding('utf8');
res.on('data', (data) => {
data = JSON.parse(data);
process.env.USER_ID = data.data.id;
process.env.API_KEY = data.data.apiToken;
});
run();
});
req.write(JSON.stringify({
"username": "username",
"email": "[email protected]",
"password": "password",
"confirmPassword": "password"
}));
req.end();
}
if (process.env.CI === 'true') {
initCI();
}
module.exports = {
extension: ['js'],
delay: process.env.CI === 'true',
};