mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-02-04 14:33:47 +00:00
add test for big json number with fetch/xhr
This commit is contained in:
@@ -862,7 +862,7 @@ fn testHTTPHandler(req: *std.http.Server.Request) !void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (std.mem.eql(u8, path, "/xhr/json")) {
|
if (std.mem.eql(u8, path, "/xhr/json")) {
|
||||||
return req.respond("{\"over\":\"9000!!!\"}", .{
|
return req.respond("{\"over\":\"9000!!!\",\"updated_at\":1765867200000}", .{
|
||||||
.extra_headers = &.{
|
.extra_headers = &.{
|
||||||
.{ .name = "Content-Type", .value = "application/json" },
|
.{ .name = "Content-Type", .value = "application/json" },
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -12,7 +12,8 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
testing.async(promise1, (json) => {
|
testing.async(promise1, (json) => {
|
||||||
testing.expectEqual({over: '9000!!!'}, json);
|
testing.expectEqual("number", typeof json.updated_at);
|
||||||
|
testing.expectEqual({over: '9000!!!',updated_at:1765867200000}, json);
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -29,6 +30,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
testing.async(promise1, (json) => {
|
testing.async(promise1, (json) => {
|
||||||
testing.expectEqual({over: '9000!!!'}, json);
|
testing.expectEqual("number", typeof json.updated_at);
|
||||||
|
testing.expectEqual({over: '9000!!!',updated_at:1765867200000}, json);
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -65,6 +65,8 @@
|
|||||||
testing.expectEqual(200, req3.status);
|
testing.expectEqual(200, req3.status);
|
||||||
testing.expectEqual('OK', req3.statusText);
|
testing.expectEqual('OK', req3.statusText);
|
||||||
testing.expectEqual('9000!!!', req3.response.over);
|
testing.expectEqual('9000!!!', req3.response.over);
|
||||||
|
testing.expectEqual("number", typeof req3.response.updated_at);
|
||||||
|
testing.expectEqual(1765867200000, req3.response.updated_at);
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user