mirror of
https://github.com/electron/electron.git
synced 2026-01-26 07:48:08 -05:00
spec: Add test case for fetch
This commit is contained in:
@@ -496,4 +496,25 @@ describe('chromium feature', function () {
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('fetch', function () {
|
||||
it('does not crash', function (done) {
|
||||
const server = http.createServer(function (req, res) {
|
||||
res.end('test')
|
||||
server.close()
|
||||
})
|
||||
server.listen(0, '127.0.0.1', function () {
|
||||
const port = server.address().port
|
||||
fetch(`http://127.0.0.1:${port}`).then((res) => {
|
||||
return res.body.getReader()
|
||||
}).then((reader) => {
|
||||
reader.read().then((r) => {
|
||||
reader.cancel()
|
||||
})
|
||||
}).catch(function (e) {
|
||||
done()
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user