From da540ef15f9107a57d86766ebc84b1be1f7a8ec4 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Wed, 30 Jan 2019 10:21:55 -0500 Subject: [PATCH] update some tests --- test/apps/basics/src/routes/b/index.html | 20 +++++----- .../basics/src/routes/delete-test/index.html | 32 ++++++++-------- .../basics/src/routes/unsafe-replacement.html | 14 +++---- .../src/routes/credentials/index.html | 20 +++++----- test/apps/css/src/routes/bar.html | 22 ++++++----- .../encoding/src/routes/echo/page/[slug].html | 21 ++++++----- test/apps/encoding/src/routes/fünke.html | 20 +++++----- test/apps/errors/src/routes/blog/[slug].html | 34 +++++++++-------- .../errors/src/routes/enhance-your-calm.html | 10 ++--- test/apps/errors/src/routes/throw.html | 10 ++--- test/apps/export/src/routes/blog/[slug].html | 20 +++++----- test/apps/export/src/routes/blog/index.html | 24 ++++++------ test/apps/ignore/src/routes/b/index.html | 20 +++++----- test/apps/layout/src/routes/[x]/[y]/[z].html | 32 ++++++++-------- .../layout/src/routes/[x]/[y]/_layout.html | 37 +++++++++---------- test/apps/preloading/src/routes/_layout.html | 26 +++++++------ .../routes/preload-values/custom-class.html | 30 ++++++++------- .../src/routes/preload-values/set.html | 20 +++++----- .../preloading/src/routes/slow-preload.html | 26 ++++++------- .../redirects/src/routes/redirect-from.html | 14 +++---- .../src/routes/redirect-to-external.html | 14 +++---- .../src/routes/redirect-to-root.html | 14 +++---- test/apps/scroll/src/routes/tall-page.html | 26 ++++++------- 23 files changed, 255 insertions(+), 251 deletions(-) diff --git a/test/apps/basics/src/routes/b/index.html b/test/apps/basics/src/routes/b/index.html index d93079d..8b1cfa6 100644 --- a/test/apps/basics/src/routes/b/index.html +++ b/test/apps/basics/src/routes/b/index.html @@ -1,11 +1,13 @@ -

{letter}

+ \ No newline at end of file + export let letter; + + +

{letter}

\ No newline at end of file diff --git a/test/apps/basics/src/routes/delete-test/index.html b/test/apps/basics/src/routes/delete-test/index.html index a5280cb..e8a2b6e 100644 --- a/test/apps/basics/src/routes/delete-test/index.html +++ b/test/apps/basics/src/routes/delete-test/index.html @@ -1,19 +1,17 @@ - - \ No newline at end of file + onMount(() => { + window.deleted = null; + }); + + function del() { + fetch(`delete-test/42.json`, { method: 'DELETE' }) + .then(r => r.json()) + .then(data => { + window.deleted = data; + }); + } + + + \ No newline at end of file diff --git a/test/apps/basics/src/routes/unsafe-replacement.html b/test/apps/basics/src/routes/unsafe-replacement.html index 98c654f..49fb001 100644 --- a/test/apps/basics/src/routes/unsafe-replacement.html +++ b/test/apps/basics/src/routes/unsafe-replacement.html @@ -1,9 +1,7 @@ -$& + - \ No newline at end of file +$& \ No newline at end of file diff --git a/test/apps/credentials/src/routes/credentials/index.html b/test/apps/credentials/src/routes/credentials/index.html index 688ece6..04a19ee 100644 --- a/test/apps/credentials/src/routes/credentials/index.html +++ b/test/apps/credentials/src/routes/credentials/index.html @@ -1,11 +1,13 @@ -

{message}

+ \ No newline at end of file + export let message; + + +

{message}

\ No newline at end of file diff --git a/test/apps/css/src/routes/bar.html b/test/apps/css/src/routes/bar.html index 876ee63..d63d069 100644 --- a/test/apps/css/src/routes/bar.html +++ b/test/apps/css/src/routes/bar.html @@ -1,11 +1,13 @@ - - \ No newline at end of file + import { onMount } from 'svelte'; + + export let Title; + + onMount(() => { + import('./_components/Title.html').then(mod => { + Title = mod.default; + }); + }); + + + \ No newline at end of file diff --git a/test/apps/encoding/src/routes/echo/page/[slug].html b/test/apps/encoding/src/routes/echo/page/[slug].html index 2cdc03d..deead40 100644 --- a/test/apps/encoding/src/routes/echo/page/[slug].html +++ b/test/apps/encoding/src/routes/echo/page/[slug].html @@ -1,11 +1,14 @@ -

{slug} {JSON.stringify(query)}

+ \ No newline at end of file + export let slug; + export let query; + + +

{slug} {JSON.stringify(query)}

\ No newline at end of file diff --git a/test/apps/encoding/src/routes/fünke.html b/test/apps/encoding/src/routes/fünke.html index e1fba6c..dbff62e 100644 --- a/test/apps/encoding/src/routes/fünke.html +++ b/test/apps/encoding/src/routes/fünke.html @@ -1,11 +1,13 @@ -

{phrase}

+ \ No newline at end of file + export let phrase; + + +

{phrase}

\ No newline at end of file diff --git a/test/apps/errors/src/routes/blog/[slug].html b/test/apps/errors/src/routes/blog/[slug].html index 8a304d0..1fe2daa 100644 --- a/test/apps/errors/src/routes/blog/[slug].html +++ b/test/apps/errors/src/routes/blog/[slug].html @@ -1,19 +1,21 @@ -

{post.title}

+ - return this.fetch(`blog/${slug}.json`).then(r => { - return r.json().then(data => { - if (r.status !== 200) { - this.error(r.status, data); - } - - return data; - }); - }); - } - }; - \ No newline at end of file +

{post.title}

\ No newline at end of file diff --git a/test/apps/errors/src/routes/enhance-your-calm.html b/test/apps/errors/src/routes/enhance-your-calm.html index 398584e..799755b 100644 --- a/test/apps/errors/src/routes/enhance-your-calm.html +++ b/test/apps/errors/src/routes/enhance-your-calm.html @@ -1,7 +1,5 @@ - \ No newline at end of file diff --git a/test/apps/errors/src/routes/throw.html b/test/apps/errors/src/routes/throw.html index 16b4131..4e4cc9a 100644 --- a/test/apps/errors/src/routes/throw.html +++ b/test/apps/errors/src/routes/throw.html @@ -1,7 +1,5 @@ - \ No newline at end of file diff --git a/test/apps/export/src/routes/blog/[slug].html b/test/apps/export/src/routes/blog/[slug].html index f44adaa..2febdf2 100644 --- a/test/apps/export/src/routes/blog/[slug].html +++ b/test/apps/export/src/routes/blog/[slug].html @@ -1,11 +1,13 @@ -

{post.title}

+ \ No newline at end of file + export let post; + + +

{post.title}

\ No newline at end of file diff --git a/test/apps/export/src/routes/blog/index.html b/test/apps/export/src/routes/blog/index.html index 2eea681..d12e432 100644 --- a/test/apps/export/src/routes/blog/index.html +++ b/test/apps/export/src/routes/blog/index.html @@ -1,15 +1,17 @@ + + + +

blog

{#each posts as post}

{post.title}

-{/each} - - \ No newline at end of file +{/each} \ No newline at end of file diff --git a/test/apps/ignore/src/routes/b/index.html b/test/apps/ignore/src/routes/b/index.html index d93079d..8b1cfa6 100644 --- a/test/apps/ignore/src/routes/b/index.html +++ b/test/apps/ignore/src/routes/b/index.html @@ -1,11 +1,13 @@ -

{letter}

+ \ No newline at end of file + export let letter; + + +

{letter}

\ No newline at end of file diff --git a/test/apps/layout/src/routes/[x]/[y]/[z].html b/test/apps/layout/src/routes/[x]/[y]/[z].html index 018f001..b51089c 100644 --- a/test/apps/layout/src/routes/[x]/[y]/[z].html +++ b/test/apps/layout/src/routes/[x]/[y]/[z].html @@ -1,20 +1,18 @@ -z: {segment} {count} -click me - - - oncreate() { - this.set({ - segment: this.get().params.z - }); - } - }; - \ No newline at end of file + + +z: {segment} {count} +click me \ No newline at end of file diff --git a/test/apps/layout/src/routes/[x]/[y]/_layout.html b/test/apps/layout/src/routes/[x]/[y]/_layout.html index 7e632a3..f60dd63 100644 --- a/test/apps/layout/src/routes/[x]/[y]/_layout.html +++ b/test/apps/layout/src/routes/[x]/[y]/_layout.html @@ -1,22 +1,21 @@ + + + + y: {segment} {count} -child segment: {child.segment} - - \ No newline at end of file +child segment: {child.segment} \ No newline at end of file diff --git a/test/apps/preloading/src/routes/_layout.html b/test/apps/preloading/src/routes/_layout.html index 4e39097..30dc0e6 100644 --- a/test/apps/preloading/src/routes/_layout.html +++ b/test/apps/preloading/src/routes/_layout.html @@ -1,15 +1,19 @@ + + + + {#if preloading} {/if} - - - \ No newline at end of file + \ No newline at end of file diff --git a/test/apps/preloading/src/routes/preload-values/custom-class.html b/test/apps/preloading/src/routes/preload-values/custom-class.html index 44e94cb..a4f0499 100644 --- a/test/apps/preloading/src/routes/preload-values/custom-class.html +++ b/test/apps/preloading/src/routes/preload-values/custom-class.html @@ -1,17 +1,19 @@ -

{foo.bar()}

+ - return { - foo: new Foo() - }; - } - }; - \ No newline at end of file +

{foo.bar()}

\ No newline at end of file diff --git a/test/apps/preloading/src/routes/preload-values/set.html b/test/apps/preloading/src/routes/preload-values/set.html index 43066c9..03a5b01 100644 --- a/test/apps/preloading/src/routes/preload-values/set.html +++ b/test/apps/preloading/src/routes/preload-values/set.html @@ -1,11 +1,13 @@ -

{set.has('x')}

+ \ No newline at end of file + export let set; + + +

{set.has('x')}

\ No newline at end of file diff --git a/test/apps/preloading/src/routes/slow-preload.html b/test/apps/preloading/src/routes/slow-preload.html index 0dc35ca..8312e4e 100644 --- a/test/apps/preloading/src/routes/slow-preload.html +++ b/test/apps/preloading/src/routes/slow-preload.html @@ -1,15 +1,13 @@ -

This page should never render

+ - \ No newline at end of file +

This page should never render

\ No newline at end of file diff --git a/test/apps/redirects/src/routes/redirect-from.html b/test/apps/redirects/src/routes/redirect-from.html index 8c419c5..2c07828 100644 --- a/test/apps/redirects/src/routes/redirect-from.html +++ b/test/apps/redirects/src/routes/redirect-from.html @@ -1,9 +1,7 @@ -

unredirected

+ - \ No newline at end of file +

unredirected

\ No newline at end of file diff --git a/test/apps/redirects/src/routes/redirect-to-external.html b/test/apps/redirects/src/routes/redirect-to-external.html index fec2fee..bc713c1 100644 --- a/test/apps/redirects/src/routes/redirect-to-external.html +++ b/test/apps/redirects/src/routes/redirect-to-external.html @@ -1,9 +1,7 @@ -

unredirected

+ - \ No newline at end of file +

unredirected

\ No newline at end of file diff --git a/test/apps/redirects/src/routes/redirect-to-root.html b/test/apps/redirects/src/routes/redirect-to-root.html index 0fa438b..63460f1 100644 --- a/test/apps/redirects/src/routes/redirect-to-root.html +++ b/test/apps/redirects/src/routes/redirect-to-root.html @@ -1,9 +1,7 @@ -

unredirected

+ - \ No newline at end of file +

unredirected

\ No newline at end of file diff --git a/test/apps/scroll/src/routes/tall-page.html b/test/apps/scroll/src/routes/tall-page.html index 67db967..8c79fb7 100644 --- a/test/apps/scroll/src/routes/tall-page.html +++ b/test/apps/scroll/src/routes/tall-page.html @@ -1,3 +1,13 @@ + + scroll to foo
@@ -7,18 +17,4 @@ {#if barLink} link {/if} - - - \ No newline at end of file + \ No newline at end of file