UNPKG

458 BJavaScriptView Raw
1import test from 'ava'
2
3var sletTest = require('slettest')
4const Slet = require('../../slet')
5
6const app = new Slet({
7 root: __dirname,
8 debug: false
9})
10
11app.router('fixtures/redirect')
12
13test.cb('should redirect to the given url', t => {
14 sletTest(app)
15 .get('/redirect')
16 .expect(204, function (err, res) {
17 t.ifError(err)
18 // console.log(res)
19 t.is(res.header.location, 'http://baidu.com', 'res.text == 1!')
20 t.end()
21 })
22})