update tests
This commit is contained in:
1
test/static/file.txt
Normal file
1
test/static/file.txt
Normal file
@ -0,0 +1 @@
|
||||
test
|
18
test/static/static.js
Normal file
18
test/static/static.js
Normal file
@ -0,0 +1,18 @@
|
||||
'use strict'
|
||||
const test = require('tape')
|
||||
const request = require('req-then')
|
||||
const LocalWebServer = require('../../')
|
||||
const c = require('../common')
|
||||
|
||||
test('static', function (t) {
|
||||
t.plan(2)
|
||||
const ws = new LocalWebServer()
|
||||
ws.addStatic(__dirname, { index: 'file.txt' })
|
||||
const server = ws.getServer()
|
||||
server.listen(8100, () => {
|
||||
request('http://localhost:8100/')
|
||||
.then(c.checkResponse(t, 200, /test/))
|
||||
.then(server.close.bind(server))
|
||||
.catch(c.fail(t))
|
||||
})
|
||||
})
|
Reference in New Issue
Block a user