Skip to content

Commit

Permalink
Test commit
Browse files Browse the repository at this point in the history
  • Loading branch information
strayfade committed Feb 25, 2024
1 parent b230946 commit a4d556c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Server.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ Server.listen(process.env.PORT || parseInt(process.argv[2]) || '8000')
Server.on('listening', () => {
const Address = Server.address()
const Binding = typeof Address === 'string' ? `pipe ${Address}` : `port ${Address.port}`
Log(`Listening on ${Binding}`)
Log(`Local address (if available): http://127.0.0.1:${Address.port}`)
if (Address.port < 10000) {
Log(`Listening on ${Binding}`)
Log(`Local address (if available): http://127.0.0.1:${Address.port}`)
}
})

module.exports = { Server }
6 changes: 6 additions & 0 deletions tests/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ describe('Server', () => {
.expect('Content-Type', /^text\/html/)
.expect(200)
})
it('serves error pages properly', async () => {
await request(Server)
.get('/404')
.expect('Content-Type', /^text\/plain/)
.expect(302)
})
it('serves other pages properly', async () => {
await request(Server)
.get('/R')
Expand Down

0 comments on commit a4d556c

Please sign in to comment.