diff --git a/test/runtime/index.js b/test/runtime/index.js index 96d7ad6445..913fddacf2 100644 --- a/test/runtime/index.js +++ b/test/runtime/index.js @@ -21,11 +21,11 @@ let compileOptions = null; let compile = null; function getName(filename) { - const base = path.basename(filename).replace('-v2', '').replace(".html", ""); + const base = path.basename(filename).replace(".html", ""); return base[0].toUpperCase() + base.slice(1); } -describe("runtime", () => { +describe.only("runtime", () => { before(() => { svelte = loadSvelte(false); svelte$ = loadSvelte(true); @@ -46,7 +46,7 @@ describe("runtime", () => { const failed = new Set(); - function runTest(dir, shared, hydrate, v2) { + function runTest(dir, shared, hydrate) { if (dir[0] === ".") return; const config = loadConfig(`./runtime/samples/${dir}/_config.js`); @@ -55,7 +55,7 @@ describe("runtime", () => { throw new Error("Forgot to remove `solo: true` from test"); } - (config.skip ? it.skip : config.solo ? it.only : it)(`${dir} (${shared ? 'shared' : 'inline'} helpers${hydrate ? ', hydration' : ''}${v2 ? ', v2' : ''})`, () => { + (config.skip ? it.skip : config.solo ? it.only : it)(`${dir} (${shared ? 'shared' : 'inline'} helpers${hydrate ? ', hydration' : ''})`, () => { if (failed.has(dir)) { // this makes debugging easier, by only printing compiled output once throw new Error('skipping test, already failed'); @@ -72,7 +72,7 @@ describe("runtime", () => { compileOptions.dev = config.dev; compileOptions.store = !!config.store; compileOptions.immutable = config.immutable; - compileOptions.parser = v2 ? 'v2' : 'v1'; + compileOptions.parser = 'v2'; // TODO remove Object.keys(require.cache) .filter(x => x.endsWith(".html")) @@ -112,7 +112,7 @@ describe("runtime", () => { }; try { - SvelteComponent = require(`./samples/${dir}/main${v2 ? '-v2' : ''}.html`); + SvelteComponent = require(`./samples/${dir}/main.html`); } catch (err) { showOutput(cwd, { shared, format: 'cjs', hydratable: hydrate, store: !!compileOptions.store }, compile); // eslint-disable-line no-console throw err; @@ -172,12 +172,12 @@ describe("runtime", () => { config.error(assert, err); } else { failed.add(dir); - showOutput(cwd, { shared, format: 'cjs', hydratable: hydrate, store: !!compileOptions.store, v2 }, compile); // eslint-disable-line no-console + showOutput(cwd, { shared, format: 'cjs', hydratable: hydrate, store: !!compileOptions.store, v2: true }, compile); // eslint-disable-line no-console throw err; } }) .then(() => { - if (config.show) showOutput(cwd, { shared, format: 'cjs', hydratable: hydrate, store: !!compileOptions.store, v2 }, compile); + if (config.show) showOutput(cwd, { shared, format: 'cjs', hydratable: hydrate, store: !!compileOptions.store, v2: true }, compile); }); }); } @@ -187,10 +187,6 @@ describe("runtime", () => { runTest(dir, shared, false); runTest(dir, shared, true); runTest(dir, null, false); - - if (fs.existsSync(`test/runtime/samples/${dir}/main-v2.html`)) { - runTest(dir, shared, false, true); - } }); it("fails if options.target is missing in dev mode", () => { diff --git a/test/runtime/samples/action-this/main.html b/test/runtime/samples/action-this/main.html index 95da3d4a8c..6eb12e1206 100644 --- a/test/runtime/samples/action-this/main.html +++ b/test/runtime/samples/action-this/main.html @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/test/runtime/samples/action-update/main.html b/test/runtime/samples/action-update/main.html index 03bd0d0ef9..6b319f5dca 100644 --- a/test/runtime/samples/action-update/main.html +++ b/test/runtime/samples/action-update/main.html @@ -1,5 +1,5 @@ -<:Window on:keydown="checkForCtrl(event)" on:keyup="checkForCtrl(event)"/> + diff --git a/test/runtime/samples/attribute-dynamic-shorthand/main.html b/test/runtime/samples/attribute-dynamic-shorthand/main.html index 25b468a8f1..9bbc477272 100644 --- a/test/runtime/samples/attribute-dynamic-shorthand/main.html +++ b/test/runtime/samples/attribute-dynamic-shorthand/main.html @@ -1,4 +1,4 @@ -
+
\ No newline at end of file diff --git a/test/runtime/samples/binding-indirect/main.html b/test/runtime/samples/binding-indirect/main.html index e1ab12c82f..df37840b43 100644 --- a/test/runtime/samples/binding-indirect/main.html +++ b/test/runtime/samples/binding-indirect/main.html @@ -1,14 +1,14 @@

Pending tasks

-{{#each tasks.filter(t => !t.done) as task}} -

{{task.description}}

-{{/each}} \ No newline at end of file +{#each tasks.filter(t => !t.done) as task} +

{task.description}

+{/each} \ No newline at end of file diff --git a/test/runtime/samples/binding-input-checkbox-deep-contextual/main.html b/test/runtime/samples/binding-input-checkbox-deep-contextual/main.html index dc385a4990..209cdbeaf7 100644 --- a/test/runtime/samples/binding-input-checkbox-deep-contextual/main.html +++ b/test/runtime/samples/binding-input-checkbox-deep-contextual/main.html @@ -1,13 +1,13 @@ -{{#each items as item}} -

{{item.description}}

-{{/each}} +{#each items as item} +

{item.description}

+{/each} -

{{numCompleted}} completed

+

{numCompleted} completed

diff --git a/test/runtime/samples/computed-function/main.html b/test/runtime/samples/computed-function/main.html index f3fc14727d..a432252166 100644 --- a/test/runtime/samples/computed-function/main.html +++ b/test/runtime/samples/computed-function/main.html @@ -1,4 +1,4 @@ -

{{scale(x)}}

+

{scale(x)}

\ No newline at end of file diff --git a/test/runtime/samples/computed-values-deconflicted/main.html b/test/runtime/samples/computed-values-deconflicted/main.html index d32fde6167..e5a016084c 100644 --- a/test/runtime/samples/computed-values-deconflicted/main.html +++ b/test/runtime/samples/computed-values-deconflicted/main.html @@ -1,4 +1,4 @@ -{{state}} +{state} \ No newline at end of file diff --git a/test/runtime/samples/computed-values-default/main-v2.html b/test/runtime/samples/computed-values-default/main-v2.html deleted file mode 100644 index b26762f3d8..0000000000 --- a/test/runtime/samples/computed-values-default/main-v2.html +++ /dev/null @@ -1,9 +0,0 @@ -

{foo}

- - diff --git a/test/runtime/samples/computed-values-default/main.html b/test/runtime/samples/computed-values-default/main.html index 74292a3a2e..b26762f3d8 100644 --- a/test/runtime/samples/computed-values-default/main.html +++ b/test/runtime/samples/computed-values-default/main.html @@ -1,9 +1,9 @@ -

{{foo}}

+

{foo}

diff --git a/test/runtime/samples/computed-values-function-dependency/main-v2.html b/test/runtime/samples/computed-values-function-dependency/main-v2.html deleted file mode 100644 index adf66137fa..0000000000 --- a/test/runtime/samples/computed-values-function-dependency/main-v2.html +++ /dev/null @@ -1,28 +0,0 @@ -

{x}

- - \ No newline at end of file diff --git a/test/runtime/samples/computed-values-function-dependency/main.html b/test/runtime/samples/computed-values-function-dependency/main.html index d385bf6da8..adf66137fa 100644 --- a/test/runtime/samples/computed-values-function-dependency/main.html +++ b/test/runtime/samples/computed-values-function-dependency/main.html @@ -1,4 +1,4 @@ -

{{x}}

+

{x}

diff --git a/test/runtime/samples/computed-values/main.html b/test/runtime/samples/computed-values/main.html index 0cee54f867..7e4f8d7728 100644 --- a/test/runtime/samples/computed-values/main.html +++ b/test/runtime/samples/computed-values/main.html @@ -1,5 +1,5 @@ -

{{a}} + {{b}} = {{c}}

-

{{c}} * {{c}} = {{cSquared}}

+

{a} + {b} = {c}

+

{c} * {c} = {cSquared}

diff --git a/test/runtime/samples/custom-method/main.html b/test/runtime/samples/custom-method/main.html index 3bd8459fb1..0f1ad3387c 100644 --- a/test/runtime/samples/custom-method/main.html +++ b/test/runtime/samples/custom-method/main.html @@ -1,6 +1,6 @@ -

{{counter}}

+

{counter}

diff --git a/test/runtime/samples/deconflict-template-1/main.html b/test/runtime/samples/deconflict-template-1/main.html index f4fe8de423..395d7b22b3 100644 --- a/test/runtime/samples/deconflict-template-1/main.html +++ b/test/runtime/samples/deconflict-template-1/main.html @@ -1,4 +1,4 @@ -{{value}} +{value} \ No newline at end of file diff --git a/test/runtime/samples/dev-warning-dynamic-components-misplaced/main.html b/test/runtime/samples/dev-warning-dynamic-components-misplaced/main.html index 37392f27e6..eb6e7d8e8e 100644 --- a/test/runtime/samples/dev-warning-dynamic-components-misplaced/main.html +++ b/test/runtime/samples/dev-warning-dynamic-components-misplaced/main.html @@ -1,4 +1,4 @@ -<:Component {x ? Foo : Bar}/> + \ No newline at end of file diff --git a/test/runtime/samples/dev-warning-readonly-window-binding/main-v2.html b/test/runtime/samples/dev-warning-readonly-window-binding/main-v2.html deleted file mode 100644 index 87b0403ee3..0000000000 --- a/test/runtime/samples/dev-warning-readonly-window-binding/main-v2.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/test/runtime/samples/dev-warning-readonly-window-binding/main.html b/test/runtime/samples/dev-warning-readonly-window-binding/main.html index 635ae75e9c..87b0403ee3 100644 --- a/test/runtime/samples/dev-warning-readonly-window-binding/main.html +++ b/test/runtime/samples/dev-warning-readonly-window-binding/main.html @@ -1 +1 @@ -<:Window bind:innerWidth='width'/> \ No newline at end of file + \ No newline at end of file diff --git a/test/runtime/samples/dynamic-component-bindings-recreated/Green-v2.html b/test/runtime/samples/dynamic-component-bindings-recreated/Green-v2.html deleted file mode 100644 index b4faa1b662..0000000000 --- a/test/runtime/samples/dynamic-component-bindings-recreated/Green-v2.html +++ /dev/null @@ -1 +0,0 @@ -

green {foo}

\ No newline at end of file diff --git a/test/runtime/samples/dynamic-component-bindings-recreated/Green.html b/test/runtime/samples/dynamic-component-bindings-recreated/Green.html index 692847c1c2..b4faa1b662 100644 --- a/test/runtime/samples/dynamic-component-bindings-recreated/Green.html +++ b/test/runtime/samples/dynamic-component-bindings-recreated/Green.html @@ -1 +1 @@ -

green {{foo}}

\ No newline at end of file +

green {foo}

\ No newline at end of file diff --git a/test/runtime/samples/dynamic-component-bindings-recreated/Red-v2.html b/test/runtime/samples/dynamic-component-bindings-recreated/Red-v2.html deleted file mode 100644 index a3e3c792a0..0000000000 --- a/test/runtime/samples/dynamic-component-bindings-recreated/Red-v2.html +++ /dev/null @@ -1 +0,0 @@ -

red {foo}

\ No newline at end of file diff --git a/test/runtime/samples/dynamic-component-bindings-recreated/Red.html b/test/runtime/samples/dynamic-component-bindings-recreated/Red.html index 8f10e3294d..a3e3c792a0 100644 --- a/test/runtime/samples/dynamic-component-bindings-recreated/Red.html +++ b/test/runtime/samples/dynamic-component-bindings-recreated/Red.html @@ -1 +1 @@ -

red {{foo}}

\ No newline at end of file +

red {foo}

\ No newline at end of file diff --git a/test/runtime/samples/dynamic-component-bindings-recreated/main-v2.html b/test/runtime/samples/dynamic-component-bindings-recreated/main-v2.html deleted file mode 100644 index 6d748ed217..0000000000 --- a/test/runtime/samples/dynamic-component-bindings-recreated/main-v2.html +++ /dev/null @@ -1,15 +0,0 @@ - - - \ No newline at end of file diff --git a/test/runtime/samples/dynamic-component-bindings-recreated/main.html b/test/runtime/samples/dynamic-component-bindings-recreated/main.html index b9cdf92660..a26c1cd080 100644 --- a/test/runtime/samples/dynamic-component-bindings-recreated/main.html +++ b/test/runtime/samples/dynamic-component-bindings-recreated/main.html @@ -1,4 +1,4 @@ -<:Component {x ? Green : Red} bind:foo /> + \ No newline at end of file diff --git a/test/runtime/samples/dynamic-component-bindings/main.html b/test/runtime/samples/dynamic-component-bindings/main.html index cb260da71f..020855cb22 100644 --- a/test/runtime/samples/dynamic-component-bindings/main.html +++ b/test/runtime/samples/dynamic-component-bindings/main.html @@ -1,4 +1,4 @@ -<:Component { x ? Foo : Bar } bind:y bind:z/> + \ No newline at end of file diff --git a/test/runtime/samples/dynamic-component-events/main.html b/test/runtime/samples/dynamic-component-events/main.html index 8606b56ce0..5fa66b2c61 100644 --- a/test/runtime/samples/dynamic-component-events/main.html +++ b/test/runtime/samples/dynamic-component-events/main.html @@ -1,4 +1,4 @@ -<:Component { x ? Foo : Bar } on:select='set({ selected: event.id })'/> + \ No newline at end of file diff --git a/test/runtime/samples/dynamic-component-inside-element/main.html b/test/runtime/samples/dynamic-component-inside-element/main.html index 2f2eb26587..0844346301 100644 --- a/test/runtime/samples/dynamic-component-inside-element/main.html +++ b/test/runtime/samples/dynamic-component-inside-element/main.html @@ -1,5 +1,5 @@
- <:Component { x ? Foo : Bar } x='{{x}}'/> +
diff --git a/test/runtime/samples/dynamic-component-ref/main.html b/test/runtime/samples/dynamic-component-ref/main.html index ff506517bc..1d54b17299 100644 --- a/test/runtime/samples/dynamic-component-ref/main.html +++ b/test/runtime/samples/dynamic-component-ref/main.html @@ -1,4 +1,4 @@ -<:Component {foo} ref:test/> + \ No newline at end of file diff --git a/test/runtime/samples/dynamic-component-slot/main.html b/test/runtime/samples/dynamic-component-slot/main.html index fd4fad1369..e8b5c487ad 100644 --- a/test/runtime/samples/dynamic-component-slot/main.html +++ b/test/runtime/samples/dynamic-component-slot/main.html @@ -1,26 +1,26 @@ -<:Component { x ? Foo : Bar } x='{{x}}'> +

element

- {{tag}} + {tag} - {{#if foo}} + {#if foo}

foo

- {{elseif bar}} + {:elseif bar}

bar

- {{else}} + {:else}

neither foo nor bar

- {{/if}} + {/if} text - {{#each things as thing}} - {{thing}} - {{/each}} + {#each things as thing} + {thing} + {/each}
what goes up must come down
- +
\ No newline at end of file diff --git a/test/runtime/samples/dynamic-component-update-existing-instance/main.html b/test/runtime/samples/dynamic-component-update-existing-instance/main.html index 127c189cc3..1f8bd35f8c 100644 --- a/test/runtime/samples/dynamic-component-update-existing-instance/main.html +++ b/test/runtime/samples/dynamic-component-update-existing-instance/main.html @@ -1,4 +1,4 @@ -<:Component { x ? Foo : Bar } x='{{x}}'/> + diff --git a/test/runtime/samples/globals-accessible-directly/main.html b/test/runtime/samples/globals-accessible-directly/main.html index 349b4b1d32..77225fa117 100644 --- a/test/runtime/samples/globals-accessible-directly/main.html +++ b/test/runtime/samples/globals-accessible-directly/main.html @@ -1 +1 @@ -{{NaN}} +{NaN} diff --git a/test/runtime/samples/globals-not-dereferenced/main.html b/test/runtime/samples/globals-not-dereferenced/main.html index 771042ed07..ec39251992 100644 --- a/test/runtime/samples/globals-not-dereferenced/main.html +++ b/test/runtime/samples/globals-not-dereferenced/main.html @@ -1 +1 @@ -{{Math.min(x, 5)}} +{Math.min(x, 5)} diff --git a/test/runtime/samples/globals-not-overwritten-by-bindings/main.html b/test/runtime/samples/globals-not-overwritten-by-bindings/main.html index ca6c6ccb35..a8b873211c 100644 --- a/test/runtime/samples/globals-not-overwritten-by-bindings/main.html +++ b/test/runtime/samples/globals-not-overwritten-by-bindings/main.html @@ -1,6 +1,6 @@ -{{#each Object.keys(todos) as key}} -
+{#each Object.keys(todos) as key} +
-{{/each}} \ No newline at end of file +{/each} \ No newline at end of file diff --git a/test/runtime/samples/globals-shadowed-by-data/main.html b/test/runtime/samples/globals-shadowed-by-data/main.html index 73fd9437af..7e3b408331 100644 --- a/test/runtime/samples/globals-shadowed-by-data/main.html +++ b/test/runtime/samples/globals-shadowed-by-data/main.html @@ -1,4 +1,4 @@ -{{Math.min(x, 5)}} +{Math.min(x, 5)} -
\ No newline at end of file diff --git a/test/runtime/samples/select-bind-array/main.html b/test/runtime/samples/select-bind-array/main.html index 7971c4fe10..67c1dfdb91 100644 --- a/test/runtime/samples/select-bind-array/main.html +++ b/test/runtime/samples/select-bind-array/main.html @@ -1,5 +1,5 @@ diff --git a/test/runtime/samples/select-bind-in-array/main.html b/test/runtime/samples/select-bind-in-array/main.html index 1a80b1afa0..9a4d1e82cd 100644 --- a/test/runtime/samples/select-bind-in-array/main.html +++ b/test/runtime/samples/select-bind-in-array/main.html @@ -1,6 +1,6 @@ -{{#each items as item}} +{#each items as item} -{{/each}} +{/each} diff --git a/test/runtime/samples/select-change-handler/main.html b/test/runtime/samples/select-change-handler/main.html index 48376dfa93..13d9bd75af 100644 --- a/test/runtime/samples/select-change-handler/main.html +++ b/test/runtime/samples/select-change-handler/main.html @@ -1,7 +1,7 @@ \ No newline at end of file diff --git a/test/runtime/samples/set-in-oncreate/main.html b/test/runtime/samples/set-in-oncreate/main.html index 8e71ec5905..77633574f1 100644 --- a/test/runtime/samples/set-in-oncreate/main.html +++ b/test/runtime/samples/set-in-oncreate/main.html @@ -1,4 +1,4 @@ -

{{foo}}

+

{foo}

\ No newline at end of file diff --git a/test/runtime/samples/window-event-custom/main.html b/test/runtime/samples/window-event-custom/main.html index af33d08d97..515d5bc4ca 100644 --- a/test/runtime/samples/window-event-custom/main.html +++ b/test/runtime/samples/window-event-custom/main.html @@ -1,6 +1,6 @@ -<:Window on:esc="set({ escaped: true })" /> + -

escaped: {{escaped}}

+

escaped: {escaped}