rewrite unit tests

This commit is contained in:
Nzix
2018-09-25 19:49:10 +08:00
parent a26ab583f3
commit 0d373be689
11 changed files with 123 additions and 165 deletions
+16
View File
@@ -0,0 +1,16 @@
const fs = require('fs')
const path = require('path')
let app
before(() => {
app = require('./app.js')
global.host = 'http://localhost:' + app.server.address().port
})
after((done) => {
app.server.close(done)
})
fs.readdirSync(path.resolve(__dirname, 'test'))
.forEach(file => {
require('./test/' + file)
})