first
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
|
||||
it('api root test', done => {
|
||||
chai.request(server)
|
||||
.get('/api')
|
||||
.end((err, res) => {
|
||||
chai.expect(err).to.be.null
|
||||
chai.expect(res).to.be.status(200)
|
||||
done()
|
||||
})
|
||||
})
|
||||
@@ -0,0 +1,17 @@
|
||||
process.env['NODE_ENV'] = 'test'
|
||||
global.chai = require('chai')
|
||||
global.chaiHttp = require('chai-http')
|
||||
global.server = require('../app')
|
||||
|
||||
global.chai.use(chaiHttp)
|
||||
|
||||
|
||||
global.importTest = (name, path) => {
|
||||
describe(name, () => {
|
||||
require(path)
|
||||
})
|
||||
}
|
||||
|
||||
describe('Project Test', () => {
|
||||
importTest('Test API', './api')
|
||||
})
|
||||
Reference in New Issue
Block a user