Verified Commit e58eeb99 authored by Aral Balkan's avatar Aral Balkan
Browse files

Update tests

parent 9207f06b
......@@ -52,6 +52,7 @@ const express = require('express')
const app = express()
app.use(express.static('.'))
const options = {} // (optional) customise your server
const server = httpsServer.createServer(options, app).listen(443, () => {
console.log(` 🎉 Serving on https://localhost\n`)
})
......
......@@ -24,11 +24,22 @@ async function secureGet (url) {
}
test('static serve', t => {
t.plan(4)
let server = httpsServer.serve('test/site', 443, async () => {
test('create server', t => {
t.plan(2)
const server = httpsServer.createServer()
t.ok(server instanceof https.Server, 'https.Server instance is returned')
server.listen(443, () => {
t.equal(server.address().port, 443, 'the requested port is set')
t.end()
server.close()
})
})
test('static serve', t => {
t.plan(2)
const server = httpsServer.serve('test/site', 443, async () => {
let response
try {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment