-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.js
40 lines (31 loc) · 949 Bytes
/
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
const mysql = require('mysql');
var assert = require('assert');
describe('end-to-end', function() {
const http = require('http');
var connection;
before(()=>{
function conncectDBS(){
connection = mysql.createConnection({
host : 'eshop',
user : 'root',
password : 'root',
});
connection.connect(err =>{
if(err){
console.error(err)
console.log('DBS unavailable, retrying in 10 second')
connection.end(err=>{
console.error('DBS unavailable, retrying in 10 second')
})
setTimeout(()=>{
conncectDBS(callback)
},10000);
}
})
}
conncectDBS()
})
it('should return -1 when the value is not present', function() {
assert.equal([1, 2, 3].indexOf(4), -1);
});
});