mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-12-17 17:38:10 +00:00
fix arena, add fetch test
This commit is contained in:
committed by
Muki Kiboigo
parent
ed11eab0a7
commit
cd763a7a35
16
src/tests/fetch/fetch.html
Normal file
16
src/tests/fetch/fetch.html
Normal file
@@ -0,0 +1,16 @@
|
||||
<script src="../testing.js"></script>
|
||||
<script id=fetch type=module>
|
||||
const promise1 = new Promise((resolve) => {
|
||||
fetch('http://127.0.0.1:9582/xhr/json')
|
||||
.then((res) => {
|
||||
return res.json()
|
||||
})
|
||||
.then((json) => {
|
||||
resolve(json);
|
||||
});
|
||||
});
|
||||
|
||||
testing.async(promise1, (json) => {
|
||||
testing.expectEqual({over: '9000!!!'}, json);
|
||||
});
|
||||
</script>
|
||||
@@ -36,3 +36,14 @@
|
||||
let emptyResponse = new Response("");
|
||||
testing.expectEqual(200, emptyResponse.status);
|
||||
</script>
|
||||
|
||||
<script id=json type=module>
|
||||
const promise1 = new Promise((resolve) => {
|
||||
let response = new Response('[]');
|
||||
response.json().then(resolve)
|
||||
});
|
||||
|
||||
testing.async(promise1, (json) => {
|
||||
testing.expectEqual([], json);
|
||||
});
|
||||
</script>ref
|
||||
|
||||
Reference in New Issue
Block a user