diff --git a/test/js/samples/window-binding-online/expected.js b/test/js/samples/window-binding-online/expected.js
new file mode 100644
index 0000000000..96271a1faf
--- /dev/null
+++ b/test/js/samples/window-binding-online/expected.js
@@ -0,0 +1,53 @@
+/* generated by Svelte vX.Y.Z */
+import {
+ SvelteComponent,
+ add_render_callback,
+ init,
+ listen,
+ noop,
+ run_all,
+ safe_not_equal
+} from "svelte/internal";
+
+function create_fragment(ctx) {
+ var dispose;
+
+ add_render_callback(ctx.onlinestatuschanged);
+
+ return {
+ c() {
+ dispose = [
+ listen(window, "online", ctx.onlinestatuschanged),
+ listen(window, "offline", ctx.onlinestatuschanged)
+ ];
+ },
+
+ m: noop,
+ p: noop,
+ i: noop,
+ o: noop,
+
+ d(detaching) {
+ run_all(dispose);
+ }
+ };
+}
+
+function instance($$self, $$props, $$invalidate) {
+ let online;
+
+ function onlinestatuschanged() {
+ $$invalidate('online', online = navigator.onLine);
+ }
+
+ return { online, onlinestatuschanged };
+}
+
+class Component extends SvelteComponent {
+ constructor(options) {
+ super();
+ init(this, options, instance, create_fragment, safe_not_equal, []);
+ }
+}
+
+export default Component;
\ No newline at end of file
diff --git a/test/js/samples/window-binding-online/input.svelte b/test/js/samples/window-binding-online/input.svelte
new file mode 100644
index 0000000000..9f4b7064d8
--- /dev/null
+++ b/test/js/samples/window-binding-online/input.svelte
@@ -0,0 +1,5 @@
+
+
+
\ No newline at end of file