Skip to content

Commit 8a9cbaf

Browse files
committed
explicitly load testing.js
1 parent 3a0a930 commit 8a9cbaf

File tree

3 files changed

+3
-12
lines changed

3 files changed

+3
-12
lines changed

src/browser/tests/window/frames.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
<script src="../testing.js"></script>
2+
13
<body>
24
<iframe src="https://httpbin.io/html" title="iframea"></iframe>
35
<iframe src="https://httpbin.io/html" title="iframeb"></iframe>

src/browser/tests/window/window.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<script src="../testing.js"></script>
12
<body></body>
23
<script id=aliases>
34
testing.expectEqual(window, window.self);

src/testing.zig

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -516,18 +516,6 @@ pub fn newRunner(file: []const u8) !void {
516516
try_catch.init(js_context);
517517
defer try_catch.deinit();
518518

519-
// if you want to make a lot of changes to testing.js, but don't want to reload
520-
// every time, use this to dynamically load it during development
521-
const content = try std.fs.cwd().readFileAlloc(arena_allocator, "src/browser/tests/testing.js", 1024 * 32);
522-
523-
// const content = @embedFile("browser/tests/testing.js");
524-
525-
js_context.eval(content, "testing.js") catch |err| {
526-
const msg = try_catch.err(arena_allocator) catch @errorName(err) orelse "unknown";
527-
std.debug.print("Failed to setup testing.js: {s}\n", .{msg});
528-
return err;
529-
};
530-
531519
const url = try std.fmt.allocPrint(arena_allocator, "http://localhost:9582/src/browser/tests/{s}", .{file});
532520
try page.navigate(url, .{});
533521
page.wait(2);

0 commit comments

Comments
 (0)