You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
rap2-delos/test/test.js

37 lines
876 B
JavaScript

7 years ago
/* global describe, it */
7 years ago
let app = require('../dist/scripts/app').default
7 years ago
let request = require('supertest').agent(app.listen())
let should = require('chai').should()
describe('App', () => {
it('/', (done) => {
request.get('/')
.expect('Content-Type', /html/)
.expect(200)
.end((err, res) => {
should.not.exist(err)
done()
})
})
it('/check.node', (done) => {
request.get('/check.node')
.expect('Content-Type', /text/)
.expect(200)
.end((err, res) => {
should.not.exist(err)
res.text.should.eq('success')
done()
})
})
it('/status.taobao', (done) => {
request.get('/status.taobao')
.expect('Content-Type', /text/)
.expect(200)
.end((err, res) => {
should.not.exist(err)
res.text.should.eq('success')
done()
})
})
})