Skip to content

Commit 517acc5

Browse files
committed
fix snapshot tests
1 parent e36c0b0 commit 517acc5

File tree

11 files changed

+19
-25
lines changed

11 files changed

+19
-25
lines changed

test/js/samples/capture-inject-state/expected.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ function instance($$self, $$props, $$invalidate) {
103103
$$subscribe_prop = () => ($$unsubscribe_prop(), $$unsubscribe_prop = subscribe(prop, $$value => $$invalidate(2, $prop = $$value)), prop);
104104

105105
$$self.$$.on_destroy.push(() => $$unsubscribe_prop());
106+
let { $$slots: slots = {}, $$scope } = $$props;
107+
validate_slots("Component", slots, []);
106108
let { prop } = $$props;
107109
validate_store(prop, "prop");
108110
$$subscribe_prop();
@@ -115,9 +117,6 @@ function instance($$self, $$props, $$invalidate) {
115117
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$") console.warn(`<Component> was created with unknown prop '${key}'`);
116118
});
117119

118-
let { $$slots = {}, $$scope } = $$props;
119-
validate_slots("Component", $$slots, []);
120-
121120
$$self.$$set = $$props => {
122121
if ("prop" in $$props) $$subscribe_prop($$invalidate(0, prop = $$props.prop));
123122
if ("alias" in $$props) $$invalidate(1, realName = $$props.alias);

test/js/samples/debug-empty/expected.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,16 +69,15 @@ function create_fragment(ctx) {
6969
}
7070

7171
function instance($$self, $$props, $$invalidate) {
72+
let { $$slots: slots = {}, $$scope } = $$props;
73+
validate_slots("Component", slots, []);
7274
let { name } = $$props;
7375
const writable_props = ["name"];
7476

7577
Object.keys($$props).forEach(key => {
7678
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$") console.warn(`<Component> was created with unknown prop '${key}'`);
7779
});
7880

79-
let { $$slots = {}, $$scope } = $$props;
80-
validate_slots("Component", $$slots, []);
81-
8281
$$self.$$set = $$props => {
8382
if ("name" in $$props) $$invalidate(0, name = $$props.name);
8483
};

test/js/samples/debug-foo-bar-baz-things/expected.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,8 @@ function create_fragment(ctx) {
170170
}
171171

172172
function instance($$self, $$props, $$invalidate) {
173+
let { $$slots: slots = {}, $$scope } = $$props;
174+
validate_slots("Component", slots, []);
173175
let { things } = $$props;
174176
let { foo } = $$props;
175177
let { bar } = $$props;
@@ -180,9 +182,6 @@ function instance($$self, $$props, $$invalidate) {
180182
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$") console.warn(`<Component> was created with unknown prop '${key}'`);
181183
});
182184

183-
let { $$slots = {}, $$scope } = $$props;
184-
validate_slots("Component", $$slots, []);
185-
186185
$$self.$$set = $$props => {
187186
if ("things" in $$props) $$invalidate(0, things = $$props.things);
188187
if ("foo" in $$props) $$invalidate(1, foo = $$props.foo);

test/js/samples/debug-foo/expected.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,8 @@ function create_fragment(ctx) {
164164
}
165165

166166
function instance($$self, $$props, $$invalidate) {
167+
let { $$slots: slots = {}, $$scope } = $$props;
168+
validate_slots("Component", slots, []);
167169
let { things } = $$props;
168170
let { foo } = $$props;
169171
const writable_props = ["things", "foo"];
@@ -172,9 +174,6 @@ function instance($$self, $$props, $$invalidate) {
172174
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$") console.warn(`<Component> was created with unknown prop '${key}'`);
173175
});
174176

175-
let { $$slots = {}, $$scope } = $$props;
176-
validate_slots("Component", $$slots, []);
177-
178177
$$self.$$set = $$props => {
179178
if ("things" in $$props) $$invalidate(0, things = $$props.things);
180179
if ("foo" in $$props) $$invalidate(1, foo = $$props.foo);

test/js/samples/debug-hoisted/expected.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ function create_fragment(ctx) {
4949
}
5050

5151
function instance($$self, $$props, $$invalidate) {
52+
let { $$slots: slots = {}, $$scope } = $$props;
53+
validate_slots("Component", slots, []);
5254
let obj = { x: 5 };
5355
let kobzol = 5;
5456
const writable_props = [];
@@ -57,8 +59,6 @@ function instance($$self, $$props, $$invalidate) {
5759
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$") console.warn(`<Component> was created with unknown prop '${key}'`);
5860
});
5961

60-
let { $$slots = {}, $$scope } = $$props;
61-
validate_slots("Component", $$slots, []);
6262
$$self.$capture_state = () => ({ obj, kobzol });
6363

6464
$$self.$inject_state = $$props => {

test/js/samples/debug-no-dependencies/expected.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,14 +136,14 @@ function create_fragment(ctx) {
136136
}
137137

138138
function instance($$self, $$props) {
139+
let { $$slots: slots = {}, $$scope } = $$props;
140+
validate_slots("Component", slots, []);
139141
const writable_props = [];
140142

141143
Object.keys($$props).forEach(key => {
142144
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$") console.warn(`<Component> was created with unknown prop '${key}'`);
143145
});
144146

145-
let { $$slots = {}, $$scope } = $$props;
146-
validate_slots("Component", $$slots, []);
147147
return [];
148148
}
149149

test/js/samples/debug-ssr-foo/expected.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* generated by Svelte vX.Y.Z */
22
import { create_ssr_component, debug, each, escape } from "svelte/internal";
33

4-
const Component = create_ssr_component(($$result, $$props, $$bindings, $$slots) => {
4+
const Component = create_ssr_component(($$result, $$props, $$bindings, slots) => {
55
let { things } = $$props;
66
let { foo } = $$props;
77
if ($$props.things === void 0 && $$bindings.things && things !== void 0) $$bindings.things(things);

test/js/samples/dev-warning-missing-data-computed/expected.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ function create_fragment(ctx) {
6565
}
6666

6767
function instance($$self, $$props, $$invalidate) {
68+
let { $$slots: slots = {}, $$scope } = $$props;
69+
validate_slots("Component", slots, []);
6870
let { foo } = $$props;
6971
let bar;
7072
const writable_props = ["foo"];
@@ -73,9 +75,6 @@ function instance($$self, $$props, $$invalidate) {
7375
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$") console.warn(`<Component> was created with unknown prop '${key}'`);
7476
});
7577

76-
let { $$slots = {}, $$scope } = $$props;
77-
validate_slots("Component", $$slots, []);
78-
7978
$$self.$$set = $$props => {
8079
if ("foo" in $$props) $$invalidate(0, foo = $$props.foo);
8180
};

test/js/samples/loop-protect/expected.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ function foo() {
6767
}
6868

6969
function instance($$self, $$props, $$invalidate) {
70+
let { $$slots: slots = {}, $$scope } = $$props;
71+
validate_slots("Component", slots, []);
7072
let node;
7173

7274
{
@@ -111,9 +113,6 @@ function instance($$self, $$props, $$invalidate) {
111113
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$") console_1.warn(`<Component> was created with unknown prop '${key}'`);
112114
});
113115

114-
let { $$slots = {}, $$scope } = $$props;
115-
validate_slots("Component", $$slots, []);
116-
117116
function div_binding($$value) {
118117
binding_callbacks[$$value ? "unshift" : "push"](() => {
119118
node = $$value;

test/js/samples/ssr-no-oncreate-etc/expected.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function swipe(node, callback) {
1515

1616
} // TODO implement
1717

18-
const Component = create_ssr_component(($$result, $$props, $$bindings, $$slots) => {
18+
const Component = create_ssr_component(($$result, $$props, $$bindings, slots) => {
1919
onMount(() => {
2020
console.log("onMount");
2121
});

0 commit comments

Comments
 (0)