1
- const chai = require ( 'chai' )
2
1
const supertest = require ( 'supertest' )
3
- const expect = require ( 'chai' ) . expect
4
2
5
3
// The client listening to the mock rest server
6
4
var client = supertest . agent ( 'http://localhost:8080' )
7
5
8
- describe ( 'running XQsuite test …' , function ( ) {
6
+ describe ( 'running XQsuite test …' , function ( ) {
9
7
this . timeout ( 60000 )
10
8
this . slow ( 45000 )
11
9
let runner = '/exist/rest/db/apps/doc/modules/test-runner.xql'
12
10
13
- it ( 'returns 0 errors or failures' , function ( done ) {
11
+ it ( 'returns 0 errors or failures' , function ( done ) {
14
12
client
15
13
. get ( runner )
16
14
. set ( 'Accept' , 'application/json' )
17
15
. expect ( 'content-type' , 'application/json; charset=utf-8' )
18
- . end ( function ( err , res ) {
16
+ . end ( function ( err , res ) { // eslint-disable-line handle-callback-err
19
17
try {
20
18
console . group ( )
21
19
console . group ( )
@@ -26,14 +24,14 @@ describe('running XQsuite test …', function() {
26
24
done ( err )
27
25
} finally {
28
26
console . group ( )
29
- res . body . testsuite . testcase . forEach ( function ( entry ) {
27
+ res . body . testsuite . testcase . forEach ( function ( entry ) {
30
28
if ( entry . failure ) {
31
29
console . error ( [ entry . name , entry . failure . message ] )
32
30
process . exit ( 1 )
33
31
} else if ( entry . error ) {
34
32
console . error ( [ entry . name , entry . error . message ] )
35
33
process . exit ( 1 )
36
- } else ( console . log ( entry . name ) )
34
+ } else ( console . log ( entry . name ) )
37
35
} )
38
36
console . groupEnd ( )
39
37
}
0 commit comments