upgrade to the latest lws

This commit is contained in:
Lloyd Brookes
2019-06-02 23:15:15 +01:00
parent bba4314444
commit 4c2fc87178
8 changed files with 97 additions and 149 deletions

View File

@ -12,7 +12,7 @@ tom.test('cli.run', async function () {
const cli = new WsCli({ logError: function () {} })
const server = cli.start()
process.argv = origArgv
const response = await fetch(`http://127.0.0.1:${port}/`)
const response = await fetch(`http://127.0.0.1:${port}/package.json`)
server.close()
a.strictEqual(response.status, 200)
})
@ -53,6 +53,6 @@ tom.test('cli.run: default-stack', async function () {
let logMsg = ''
const cli = new WsCli({ log: function (msg) { logMsg = msg } })
cli.start()
a.ok(/lws-rewrite/.test(logMsg))
a.ok(/lws-static/.test(logMsg))
process.argv = origArgv
})

View File

@ -7,13 +7,12 @@ const tom = module.exports = new Tom('test')
tom.test('basic', async function () {
const port = 9000 + this.index
const localWebServer = new LocalWebServer()
const server = localWebServer.listen({
const ws = LocalWebServer.create({
port: port,
directory: 'test/fixture'
})
const response = await fetch(`http://localhost:${port}/one.txt`)
server.close()
ws.server.close()
const body = await response.text()
a.strictEqual(body, 'one\n')
})