Skip to content

Commit

Permalink
fixed browser tests for favicon.ico console error
Browse files Browse the repository at this point in the history
  • Loading branch information
brainfoolong committed Jan 29, 2025
1 parent 24ec1c4 commit 59a6a77
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/test-browser-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ const port = 6597

const server = http.createServer((req, res) => {
res.statusCode = 200
if (req.url.endsWith('.html')) {
if (req.url.endsWith('favicon.ico')) {
res.end()
} else if (req.url.endsWith('.html')) {
res.setHeader('Content-Type', 'text/html')
res.end(fs.readFileSync(__dirname + '/../' + req.url))
} else if (req.url.endsWith('.js')) {
Expand All @@ -15,7 +17,6 @@ const server = http.createServer((req, res) => {
} else {
res.statusCode = 404
res.end()
return
}
})

Expand Down

0 comments on commit 59a6a77

Please sign in to comment.