(url)
| 7 | const { WebUiServer } = require('../src/webui'); |
| 8 | |
| 9 | function request(url) { |
| 10 | return new Promise((resolve, reject) => { |
| 11 | http.get(url, (res) => { |
| 12 | const chunks = []; |
| 13 | res.on('data', (chunk) => chunks.push(chunk)); |
| 14 | res.on('end', () => { |
| 15 | const raw = Buffer.concat(chunks).toString(); |
| 16 | resolve({ status: res.statusCode, headers: res.headers, body: raw }); |
| 17 | }); |
| 18 | }).on('error', reject); |
| 19 | }); |
| 20 | } |
| 21 | |
| 22 | describe('WebUiServer', () => { |
| 23 | let server; |