add test for big json number with fetch/xhr

This commit is contained in:
Pierre Tachoire
2025-12-25 12:32:06 +01:00
parent e9ec089f76
commit 8f2921f61f
3 changed files with 7 additions and 2 deletions

View File

@@ -35,7 +35,9 @@
const json = await response.json();
testing.expectEqual('9000!!!', json.over);
testing.expectEqual("number", typeof json.updated_at);
testing.expectEqual(1765867200000, json.updated_at);
testing.expectEqual({over: '9000!!!',updated_at:1765867200000}, json);
});
</script>

View File

@@ -75,6 +75,9 @@
testing.expectEqual(200, req3.status);
testing.expectEqual('OK', req3.statusText);
testing.expectEqual('9000!!!', req3.response.over);
testing.expectEqual("number", typeof json.updated_at);
testing.expectEqual(1765867200000, json.updated_at);
testing.expectEqual({over: '9000!!!',updated_at:1765867200000}, json);
});
</script>

View File

@@ -516,7 +516,7 @@ fn testHTTPHandler(req: *std.http.Server.Request) !void {
}
if (std.mem.eql(u8, path, "/xhr/json")) {
return req.respond("{\"over\":\"9000!!!\"}", .{
return req.respond("{\"over\":\"9000!!!\",\"updated_at\":1765867200000}", .{
.extra_headers = &.{
.{ .name = "Content-Type", .value = "application/json" },
},