(path?: string | Buffer, opts?: Omit<FaviconOptions, 'path'>)
| 7 | const FAVICON_PATH = path.join(__dirname, '../fixtures/favicon.ico') |
| 8 | |
| 9 | function createServer(path?: string | Buffer, opts?: Omit<FaviconOptions, 'path'>) { |
| 10 | const _path = path || FAVICON_PATH |
| 11 | const _favicon = favicon(_path, opts) |
| 12 | const server = http.createServer( |
| 13 | async (req, res) => |
| 14 | void _favicon(req, res, (err) => { |
| 15 | res.statusCode = err ? err.status || 500 : 404 |
| 16 | res.end(err ? err.message : 'oops') |
| 17 | }) |
| 18 | ) |
| 19 | |
| 20 | return server |
| 21 | } |
| 22 | |
| 23 | describe('favicon function test', () => { |
| 24 | describe('args', () => { |
no test coverage detected