-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.js
49 lines (46 loc) · 1.02 KB
/
test.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
49
const tesults = require('./index.js')
let x = { abc: "def"};
x.y = x;
const data = {
target: 'target',
results: {
cases: [
{
name: 'Test 1',
desc: 'Test 1 description.',
suite: 'Suite A',
result: 'fail',
reason: x
},
{
name: 'Test 2',
desc: 'Test 2 description.',
suite: 'Suite A',
result: 'fail',
reason: 'Assert fail in line 203, example.js'
},
{
name: 'Test 3',
desc: 'Test 3 description.',
suite: 'Suite B',
result: 'pass',
params: {
param1: 'value1',
param2: 'value2'
},
files: ['/path/to/file/log.txt']
}
],
build: '1.0.0'
}
}
tesults.results(data, function (err, response) {
if (err) {
console.log('Error: ' + err);
} else {
console.log('Success: ' + response.success);
console.log('Message: ' + response.message);
console.log('Warnings: ' + response.warnings.length);
console.log('Errors: ' + response.errors.length);
}
});