diff --git a/test/helpers.js b/test/helpers.js index 2e6878f8a5..514d084698 100644 --- a/test/helpers.js +++ b/test/helpers.js @@ -49,6 +49,7 @@ virtualConsole.sendTo(console); global.window = new jsdom.JSDOM('
', {virtualConsole}).window; global.document = window.document; +global.requestAnimationFrame = null; // placeholder, filled in using set_raf // add missing ecmascript globals to window for (const key of Object.getOwnPropertyNames(global)) { diff --git a/test/js/samples/bind-online/expected.js b/test/js/samples/bind-online/expected.js index 9c3fdb7385..0c9faa3ef6 100644 --- a/test/js/samples/bind-online/expected.js +++ b/test/js/samples/bind-online/expected.js @@ -4,11 +4,9 @@ import { add_render_callback, init, listen, - navigator, noop, run_all, - safe_not_equal, - window + safe_not_equal } from "svelte/internal"; function create_fragment(ctx) { diff --git a/test/js/samples/collapses-text-around-comments/expected.js b/test/js/samples/collapses-text-around-comments/expected.js index ed01b6430f..12164d0579 100644 --- a/test/js/samples/collapses-text-around-comments/expected.js +++ b/test/js/samples/collapses-text-around-comments/expected.js @@ -3,7 +3,6 @@ import { SvelteComponent, append, detach, - document, element, init, insert, diff --git a/test/js/samples/css-media-query/expected.js b/test/js/samples/css-media-query/expected.js index 8a99d70e8e..d4be134376 100644 --- a/test/js/samples/css-media-query/expected.js +++ b/test/js/samples/css-media-query/expected.js @@ -3,7 +3,6 @@ import { SvelteComponent, append, detach, - document, element, init, insert, diff --git a/test/js/samples/css-shadow-dom-keyframes/expected.js b/test/js/samples/css-shadow-dom-keyframes/expected.js index 3be52803d7..9f70b8ec66 100644 --- a/test/js/samples/css-shadow-dom-keyframes/expected.js +++ b/test/js/samples/css-shadow-dom-keyframes/expected.js @@ -1,7 +1,6 @@ /* generated by Svelte vX.Y.Z */ import { SvelteElement, - customElements, detach, element, init, diff --git a/test/js/samples/debug-empty/expected.js b/test/js/samples/debug-empty/expected.js index 2e4f9feb13..6f07993590 100644 --- a/test/js/samples/debug-empty/expected.js +++ b/test/js/samples/debug-empty/expected.js @@ -1,11 +1,8 @@ /* generated by Svelte vX.Y.Z */ import { - Error, - Object, SvelteComponentDev, add_location, append, - console, detach, element, init, diff --git a/test/js/samples/debug-foo-bar-baz-things/expected.js b/test/js/samples/debug-foo-bar-baz-things/expected.js index c083ea29c3..eea35d5ba7 100644 --- a/test/js/samples/debug-foo-bar-baz-things/expected.js +++ b/test/js/samples/debug-foo-bar-baz-things/expected.js @@ -1,11 +1,8 @@ /* generated by Svelte vX.Y.Z */ import { - Error, - Object, SvelteComponentDev, add_location, append, - console, destroy_each, detach, element, diff --git a/test/js/samples/debug-foo/expected.js b/test/js/samples/debug-foo/expected.js index 46096466c1..5b931d9464 100644 --- a/test/js/samples/debug-foo/expected.js +++ b/test/js/samples/debug-foo/expected.js @@ -1,11 +1,8 @@ /* generated by Svelte vX.Y.Z */ import { - Error, - Object, SvelteComponentDev, add_location, append, - console, destroy_each, detach, element, diff --git a/test/js/samples/debug-hoisted/expected.js b/test/js/samples/debug-hoisted/expected.js index 799f0d4b32..51d8bf63a3 100644 --- a/test/js/samples/debug-hoisted/expected.js +++ b/test/js/samples/debug-hoisted/expected.js @@ -1,8 +1,6 @@ /* generated by Svelte vX.Y.Z */ import { - Error, SvelteComponentDev, - console, init, noop, safe_not_equal diff --git a/test/js/samples/deconflict-builtins/expected.js b/test/js/samples/deconflict-builtins/expected.js index 85f3c31597..3294778aa3 100644 --- a/test/js/samples/deconflict-builtins/expected.js +++ b/test/js/samples/deconflict-builtins/expected.js @@ -1,6 +1,5 @@ /* generated by Svelte vX.Y.Z */ import { - Object, SvelteComponent, append, destroy_each, diff --git a/test/js/samples/dev-warning-missing-data-computed/expected.js b/test/js/samples/dev-warning-missing-data-computed/expected.js index d61f8f3de3..5c4b2ece1b 100644 --- a/test/js/samples/dev-warning-missing-data-computed/expected.js +++ b/test/js/samples/dev-warning-missing-data-computed/expected.js @@ -1,11 +1,8 @@ /* generated by Svelte vX.Y.Z */ import { - Error, - Object, SvelteComponentDev, add_location, append, - console, detach, element, init, diff --git a/test/js/samples/each-block-array-literal/expected.js b/test/js/samples/each-block-array-literal/expected.js index 934c5cfe92..455cb2f25f 100644 --- a/test/js/samples/each-block-array-literal/expected.js +++ b/test/js/samples/each-block-array-literal/expected.js @@ -1,6 +1,5 @@ /* generated by Svelte vX.Y.Z */ import { - Object, SvelteComponent, append, destroy_each, diff --git a/test/js/samples/each-block-changed-check/expected.js b/test/js/samples/each-block-changed-check/expected.js index 4ed8756b9a..951565bae4 100644 --- a/test/js/samples/each-block-changed-check/expected.js +++ b/test/js/samples/each-block-changed-check/expected.js @@ -1,6 +1,5 @@ /* generated by Svelte vX.Y.Z */ import { - Object, SvelteComponent, append, destroy_each, diff --git a/test/js/samples/each-block-keyed-animated/expected.js b/test/js/samples/each-block-keyed-animated/expected.js index 9e777f25ee..ec28e60d5f 100644 --- a/test/js/samples/each-block-keyed-animated/expected.js +++ b/test/js/samples/each-block-keyed-animated/expected.js @@ -1,7 +1,5 @@ /* generated by Svelte vX.Y.Z */ import { - Map, - Object, SvelteComponent, append, create_animation, diff --git a/test/js/samples/each-block-keyed/expected.js b/test/js/samples/each-block-keyed/expected.js index 7ac66a09a7..efb58ebf6a 100644 --- a/test/js/samples/each-block-keyed/expected.js +++ b/test/js/samples/each-block-keyed/expected.js @@ -1,7 +1,5 @@ /* generated by Svelte vX.Y.Z */ import { - Map, - Object, SvelteComponent, append, destroy_block, diff --git a/test/js/samples/head-no-whitespace/expected.js b/test/js/samples/head-no-whitespace/expected.js index 859891e689..b95177bba7 100644 --- a/test/js/samples/head-no-whitespace/expected.js +++ b/test/js/samples/head-no-whitespace/expected.js @@ -3,7 +3,6 @@ import { SvelteComponent, append, detach, - document, element, init, noop, diff --git a/test/js/samples/media-bindings/expected.js b/test/js/samples/media-bindings/expected.js index ec30a98161..f45f9ce8db 100644 --- a/test/js/samples/media-bindings/expected.js +++ b/test/js/samples/media-bindings/expected.js @@ -2,12 +2,10 @@ import { SvelteComponent, add_render_callback, - cancelAnimationFrame, detach, element, init, insert, - isNaN, listen, noop, raf, diff --git a/test/js/samples/title/expected.js b/test/js/samples/title/expected.js index 2e551ae426..884f39e246 100644 --- a/test/js/samples/title/expected.js +++ b/test/js/samples/title/expected.js @@ -1,7 +1,6 @@ /* generated by Svelte vX.Y.Z */ import { SvelteComponent, - document, init, noop, safe_not_equal diff --git a/test/js/samples/window-binding-scroll/expected.js b/test/js/samples/window-binding-scroll/expected.js index 1e63973518..ed76058ee2 100644 --- a/test/js/samples/window-binding-scroll/expected.js +++ b/test/js/samples/window-binding-scroll/expected.js @@ -3,7 +3,6 @@ import { SvelteComponent, add_render_callback, append, - clearTimeout, detach, element, init, @@ -11,10 +10,8 @@ import { listen, noop, safe_not_equal, - setTimeout, set_data, - text, - window + text } from "svelte/internal"; function create_fragment(ctx) { @@ -45,7 +42,7 @@ function create_fragment(ctx) { if (changed.y && !scrolling) { scrolling = true; clearTimeout(scrolling_timeout); - window.scrollTo(window.pageXOffset, ctx.y); + scrollTo(pageXOffset, ctx.y); scrolling_timeout = setTimeout(clear_scrolling, 100); }