From 957093e81a68897ec8ad71303169b525af9ea419 Mon Sep 17 00:00:00 2001 From: Conduitry Date: Tue, 5 Mar 2019 12:34:47 -0500 Subject: [PATCH] update tests --- .../samples/dev-warning-missing-data-computed/expected.js | 4 ++-- .../reactive-values-non-topologically-ordered/expected.js | 6 +++--- .../reactive-values-non-writable-dependencies/expected.js | 6 +++--- .../_config.js | 6 +++--- .../main.svelte | 0 5 files changed, 11 insertions(+), 11 deletions(-) rename test/runtime/samples/{reactive-values-readonly => reactive-values-overwrite}/_config.js (76%) rename test/runtime/samples/{reactive-values-readonly => reactive-values-overwrite}/main.svelte (100%) 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 e3dff9649d..dcd1078a6d 100644 --- a/test/js/samples/dev-warning-missing-data-computed/expected.js +++ b/test/js/samples/dev-warning-missing-data-computed/expected.js @@ -56,8 +56,8 @@ function instance($$self, $$props, $$invalidate) { if ('foo' in $$props) $$invalidate('foo', foo = $$props.foo); }; - $$self.$$.update = ($$dirty = { bar: 1, foo: 1 }) => { - if ($$dirty.bar || $$dirty.foo) { + $$self.$$.update = ($$dirty = { foo: 1 }) => { + if ($$dirty.foo) { bar = foo * 2; $$invalidate('bar', bar); } }; diff --git a/test/js/samples/reactive-values-non-topologically-ordered/expected.js b/test/js/samples/reactive-values-non-topologically-ordered/expected.js index de1a4cdc8c..edf98e9613 100644 --- a/test/js/samples/reactive-values-non-topologically-ordered/expected.js +++ b/test/js/samples/reactive-values-non-topologically-ordered/expected.js @@ -22,11 +22,11 @@ function instance($$self, $$props, $$invalidate) { if ('x' in $$props) $$invalidate('x', x = $$props.x); }; - $$self.$$.update = ($$dirty = { b: 1, x: 1, a: 1 }) => { - if ($$dirty.b || $$dirty.x) { + $$self.$$.update = ($$dirty = { x: 1, b: 1 }) => { + if ($$dirty.x) { b = x; $$invalidate('b', b); } - if ($$dirty.a || $$dirty.b) { + if ($$dirty.b) { a = b; $$invalidate('a', a); } }; diff --git a/test/js/samples/reactive-values-non-writable-dependencies/expected.js b/test/js/samples/reactive-values-non-writable-dependencies/expected.js index fc2ca37d31..42f57a0037 100644 --- a/test/js/samples/reactive-values-non-writable-dependencies/expected.js +++ b/test/js/samples/reactive-values-non-writable-dependencies/expected.js @@ -17,12 +17,12 @@ let a = 1; let b = 2; function instance($$self, $$props, $$invalidate) { - + let max; - $$self.$$.update = ($$dirty = { max: 1, Math: 1, a: 1, b: 1 }) => { - if ($$dirty.max || $$dirty.a || $$dirty.b) { + $$self.$$.update = ($$dirty = { Math: 1, a: 1, b: 1 }) => { + if ($$dirty.a || $$dirty.b) { max = Math.max(a, b); $$invalidate('max', max); } }; diff --git a/test/runtime/samples/reactive-values-readonly/_config.js b/test/runtime/samples/reactive-values-overwrite/_config.js similarity index 76% rename from test/runtime/samples/reactive-values-readonly/_config.js rename to test/runtime/samples/reactive-values-overwrite/_config.js index bf5c9dbb67..644a49ec0d 100644 --- a/test/runtime/samples/reactive-values-readonly/_config.js +++ b/test/runtime/samples/reactive-values-overwrite/_config.js @@ -11,11 +11,11 @@ export default {

doubled: 4

`); - component.doubled = 6; + component.doubled = 3; - assert.equal(component.doubled, 4); + assert.equal(component.doubled, 3); assert.htmlEqual(target.innerHTML, ` -

doubled: 4

+

doubled: 3

`); } }; diff --git a/test/runtime/samples/reactive-values-readonly/main.svelte b/test/runtime/samples/reactive-values-overwrite/main.svelte similarity index 100% rename from test/runtime/samples/reactive-values-readonly/main.svelte rename to test/runtime/samples/reactive-values-overwrite/main.svelte