Skip to content

Commit aa16f66

Browse files
committed
chore: fix
1 parent d848614 commit aa16f66

File tree

7 files changed

+29
-21
lines changed

7 files changed

+29
-21
lines changed

packages/e2e-tests/import-queries/__tests__/__snapshots__/svelte-5/all.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -492,10 +492,10 @@
492492
},
493493
"dependencies": [],
494494
"js": {
495-
"code": "import \"svelte/internal/disclose-version\";\nimport * as $ from \"svelte/internal/client\";\n\nvar root = $.template(`<button class=\"svelte-d8vj6a\"> </button>`);\n\nexport default function Dummy($$anchor, $$props) {\n\tlet name = $.prop($$props, \"name\", 8);\n\tlet clicks = $.mutable_state(0);\n\tvar button = root();\n\tvar text = $.child(button);\n\n\t$.reset(button);\n\t$.template_effect(() => $.set_text(text, `${name() ?? \"\"} clicks: ${$.get(clicks) ?? \"\"}`));\n\n\t$.event(\"click\", button, () => {\n\t\t$.update(clicks);\n\t});\n\n\t$.append($$anchor, button);\n}",
495+
"code": "import \"svelte/internal/disclose-version\";\nimport \"svelte/internal/flags/legacy\";\nimport * as $ from \"svelte/internal/client\";\n\nvar root = $.template(`<button class=\"svelte-d8vj6a\"> </button>`);\n\nexport default function Dummy($$anchor, $$props) {\n\tlet name = $.prop($$props, \"name\", 8);\n\tlet clicks = $.mutable_state(0);\n\tvar button = root();\n\tvar text = $.child(button);\n\n\t$.reset(button);\n\t$.template_effect(() => $.set_text(text, `${name() ?? \"\"} clicks: ${$.get(clicks) ?? \"\"}`));\n\n\t$.event(\"click\", button, () => {\n\t\t$.update(clicks);\n\t});\n\n\t$.append($$anchor, button);\n}",
496496
"map": {
497497
"version": 3,
498-
"mappings": ";;;;;;KACY,IAAY;KACnB,MAAM,mBAAG,CAAC;;;;;6CAMV,IAAI,0BAAW,MAAM;;;WADxB,MAAM",
498+
"mappings": ";;;;;;;KACY,IAAY;KACnB,MAAM,mBAAG,CAAC;;;;;6CAMV,IAAI,0BAAW,MAAM;;;WADxB,MAAM",
499499
"names": [],
500500
"ignoreList": [],
501501
"sources": [

packages/e2e-tests/import-queries/__tests__/__snapshots__/svelte-5/custom-element.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import "svelte/internal/disclose-version";
2+
import "svelte/internal/flags/legacy";
23
import * as $ from "svelte/internal/client";
34

45
var root = $.template(`<button class="svelte-d8vj6a"> </button>`);
56

67
const $$css = {
78
hash: "svelte-d8vj6a",
8-
code: "button.svelte-d8vj6a {\n color: #000099;\n}"
9+
code: "button.svelte-d8vj6a {color:#000099;}"
910
};
1011

1112
export default function Dummy($$anchor, $$props) {

packages/e2e-tests/import-queries/__tests__/__snapshots__/svelte-5/mixed-all.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export const ast={"html":{"type":"Fragment","start":73,"end":149,"children":[{"type":"Text","start":71,"end":73,"raw":"\n\n","data":"\n\n"},{"type":"Element","start":73,"end":149,"name":"button","attributes":[{"start":82,"end":115,"type":"EventHandler","name":"click","modifiers":[],"expression":{"type":"ArrowFunctionExpression","start":92,"end":114,"loc":{"start":{"line":7,"column":11},"end":{"line":9,"column":2}},"id":null,"expression":false,"generator":false,"async":false,"params":[],"body":{"type":"BlockStatement","start":98,"end":114,"loc":{"start":{"line":7,"column":17},"end":{"line":9,"column":2}},"body":[{"type":"ExpressionStatement","start":102,"end":111,"loc":{"start":{"line":8,"column":2},"end":{"line":8,"column":11}},"expression":{"type":"UpdateExpression","start":102,"end":110,"loc":{"start":{"line":8,"column":2},"end":{"line":8,"column":10}},"operator":"++","prefix":false,"argument":{"type":"Identifier","start":102,"end":108,"loc":{"start":{"line":8,"column":2},"end":{"line":8,"column":8}},"name":"clicks"}}}]},"metadata":{"hoisted":false,"hoisted_params":[],"scope":{"root":{"conflicts":{}},"parent":{"root":{"conflicts":{}},"parent":{"root":{"conflicts":{}},"parent":{"root":{"conflicts":{}},"parent":{"root":{"conflicts":{}},"parent":{"root":{"conflicts":{}},"parent":null,"declarations":{},"declarators":{},"references":{},"function_depth":0},"declarations":{},"declarators":{},"references":{},"function_depth":1},"declarations":{},"declarators":{},"references":{},"function_depth":2},"declarations":{},"declarators":{},"references":{},"function_depth":3},"declarations":{},"declarators":{},"references":{},"function_depth":4},"declarations":{},"declarators":{},"references":{},"function_depth":5}}}},{"type":"Attribute","start":-1,"end":-1,"name":"class","value":[{"type":"Text","data":"svelte-d8vj6a","raw":"svelte-d8vj6a","start":-1,"end":-1}]}],"children":[{"type":"MustacheTag","start":116,"end":122,"expression":{"type":"Identifier","start":117,"end":121,"loc":{"start":{"line":9,"column":5},"end":{"line":9,"column":9}},"name":"name"}},{"type":"Text","start":122,"end":131,"raw":" clicks: ","data":" clicks: "},{"type":"MustacheTag","start":131,"end":139,"expression":{"type":"Identifier","start":132,"end":138,"loc":{"start":{"line":9,"column":20},"end":{"line":9,"column":26}},"name":"clicks"}}]},{"type":"Text","start":149,"end":151,"raw":"\n\n","data":"\n\n"}]},"instance":{"type":"Script","start":0,"end":71,"context":"default","content":{"type":"Program","start":18,"end":62,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":0}},"body":[{"type":"ExportNamedDeclaration","start":20,"end":44,"loc":{"start":{"line":2,"column":1},"end":{"line":2,"column":25}},"exportKind":"value","declaration":{"type":"VariableDeclaration","start":27,"end":44,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":25}},"declarations":[{"type":"VariableDeclarator","start":31,"end":43,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":24}},"id":{"type":"Identifier","start":31,"end":35,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":24}},"name":"name","typeAnnotation":{"type":"EmptyStatement"}},"init":null}],"kind":"let"},"specifiers":[],"source":null},{"type":"VariableDeclaration","start":46,"end":61,"loc":{"start":{"line":3,"column":1},"end":{"line":3,"column":16}},"declarations":[{"type":"VariableDeclarator","start":50,"end":60,"loc":{"start":{"line":3,"column":5},"end":{"line":3,"column":15}},"id":{"type":"Identifier","start":50,"end":56,"loc":{"start":{"line":3,"column":5},"end":{"line":3,"column":11}},"name":"clicks"},"init":{"type":"Literal","start":59,"end":60,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":15}},"value":0,"raw":"0"}}],"kind":"let"}],"sourceType":"module"}},"css":{"type":"Style","start":151,"end":206,"attributes":[{"type":"Attribute","start":158,"end":169,"name":"lang","value":[{"start":164,"end":168,"type":"Text","raw":"scss","data":"scss"}]}],"children":[{"type":"Rule","prelude":{"type":"SelectorList","start":170,"end":176,"children":[{"type":"Selector","start":170,"end":176,"children":[{"type":"TypeSelector","name":"button","start":170,"end":176}]}]},"block":{"type":"Block","start":177,"end":198,"children":[{"type":"Declaration","start":181,"end":195,"property":"color","value":"#000099"}]},"start":170,"end":198}],"content":{"start":170,"end":198,"styles":"button {\n color: #000099;\n}","comment":null}}}
22
export const css={"code":"button.svelte-d8vj6a {\n color: #000099;\n}","map":{"version":3,"file":"Dummy.svelte","mappings":"AAWkB","names":[],"ignoreList":[],"sources":["Dummy.svelte"]}}
33
export const dependencies=[]
4-
export const js={"code":"import \"svelte/internal/disclose-version\";\nimport * as $ from \"svelte/internal/client\";\n\nvar root = $.template(`<button class=\"svelte-d8vj6a\"> </button>`);\n\nexport default function Dummy($$anchor, $$props) {\n\tlet name = $.prop($$props, \"name\", 8);\n\tlet clicks = $.mutable_state(0);\n\tvar button = root();\n\tvar text = $.child(button);\n\n\t$.reset(button);\n\t$.template_effect(() => $.set_text(text, `${name() ?? \"\"} clicks: ${$.get(clicks) ?? \"\"}`));\n\n\t$.event(\"click\", button, () => {\n\t\t$.update(clicks);\n\t});\n\n\t$.append($$anchor, button);\n}","map":{"version":3,"mappings":";;;;;;KACY,IAAY;KACnB,MAAM,mBAAG,CAAC;;;;;6CAMV,IAAI,0BAAW,MAAM;;;WADxB,MAAM","names":[],"ignoreList":[],"sources":["Dummy.svelte"]}}
4+
export const js={"code":"import \"svelte/internal/disclose-version\";\nimport \"svelte/internal/flags/legacy\";\nimport * as $ from \"svelte/internal/client\";\n\nvar root = $.template(`<button class=\"svelte-d8vj6a\"> </button>`);\n\nexport default function Dummy($$anchor, $$props) {\n\tlet name = $.prop($$props, \"name\", 8);\n\tlet clicks = $.mutable_state(0);\n\tvar button = root();\n\tvar text = $.child(button);\n\n\t$.reset(button);\n\t$.template_effect(() => $.set_text(text, `${name() ?? \"\"} clicks: ${$.get(clicks) ?? \"\"}`));\n\n\t$.event(\"click\", button, () => {\n\t\t$.update(clicks);\n\t});\n\n\t$.append($$anchor, button);\n}","map":{"version":3,"mappings":";;;;;;;KACY,IAAY;KACnB,MAAM,mBAAG,CAAC;;;;;6CAMV,IAAI,0BAAW,MAAM;;;WADxB,MAAM","names":[],"ignoreList":[],"sources":["Dummy.svelte"]}}
55
export const lang="ts"
66
export const metadata={"runes":false}
77
export const normalizedFilename="/src/Dummy.svelte"
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
export const code="import \"svelte/internal/disclose-version\";\nimport * as $ from \"svelte/internal/client\";\n\nvar root = $.template(`<button class=\"svelte-d8vj6a\"> </button>`);\n\nexport default function Dummy($$anchor, $$props) {\n\tlet name = $.prop($$props, \"name\", 8);\n\tlet clicks = $.mutable_state(0);\n\tvar button = root();\n\tvar text = $.child(button);\n\n\t$.reset(button);\n\t$.template_effect(() => $.set_text(text, `${name() ?? \"\"} clicks: ${$.get(clicks) ?? \"\"}`));\n\n\t$.event(\"click\", button, () => {\n\t\t$.update(clicks);\n\t});\n\n\t$.append($$anchor, button);\n}"
2-
export const map={"version":3,"mappings":";;;;;;KACY,IAAY;KACnB,MAAM,mBAAG,CAAC;;;;;6CAMV,IAAI,0BAAW,MAAM;;;WADxB,MAAM","names":[],"ignoreList":[],"sources":["Dummy.svelte"]}
1+
export const code="import \"svelte/internal/disclose-version\";\nimport \"svelte/internal/flags/legacy\";\nimport * as $ from \"svelte/internal/client\";\n\nvar root = $.template(`<button class=\"svelte-d8vj6a\"> </button>`);\n\nexport default function Dummy($$anchor, $$props) {\n\tlet name = $.prop($$props, \"name\", 8);\n\tlet clicks = $.mutable_state(0);\n\tvar button = root();\n\tvar text = $.child(button);\n\n\t$.reset(button);\n\t$.template_effect(() => $.set_text(text, `${name() ?? \"\"} clicks: ${$.get(clicks) ?? \"\"}`));\n\n\t$.event(\"click\", button, () => {\n\t\t$.update(clicks);\n\t});\n\n\t$.append($$anchor, button);\n}"
2+
export const map={"version":3,"mappings":";;;;;;;KACY,IAAY;KACnB,MAAM,mBAAG,CAAC;;;;;6CAMV,IAAI,0BAAW,MAAM;;;WADxB,MAAM","names":[],"ignoreList":[],"sources":["Dummy.svelte"]}
33
export default code

packages/e2e-tests/import-queries/__tests__/__snapshots__/svelte-5/script.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import "svelte/internal/disclose-version";
2+
import "svelte/internal/flags/legacy";
23
import * as $ from "svelte/internal/client";
34

45
var root = $.template(`<button class="svelte-d8vj6a"> </button>`);

packages/e2e-tests/import-queries/__tests__/import-queries.spec.ts

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,59 +29,61 @@ describe('raw', () => {
2929

3030
test('Dummy.svelte?raw', async () => {
3131
const result = await getText('#raw');
32-
expect(result).toMatchFileSnapshot(snapshotFilename('raw'));
32+
await expect(result).toMatchFileSnapshot(snapshotFilename('raw'));
3333
});
3434

3535
test('Dummy.svelte?raw&svelte&type=preprocessed', async () => {
3636
const result = await getText('#preprocessed');
37-
expect(result).toMatchFileSnapshot(snapshotFilename('preprocessed'));
37+
await expect(result).toMatchFileSnapshot(snapshotFilename('preprocessed'));
3838
});
3939

4040
test('Dummy.svelte?raw&svelte&type=script', async () => {
4141
const result = await getText('#script');
42-
expect(normalizeSnapshot(result)).toMatchFileSnapshot(snapshotFilename('script'));
42+
await expect(normalizeSnapshot(result)).toMatchFileSnapshot(snapshotFilename('script'));
4343
});
4444

4545
test('Dummy.svelte?raw&svelte&type=script&compilerOptions={"customElement":true}', async () => {
4646
const result = await getText('#wcScript');
4747

48-
expect(normalizeSnapshot(result)).toMatchFileSnapshot(snapshotFilename('custom-element'));
48+
await expect(normalizeSnapshot(result)).toMatchFileSnapshot(snapshotFilename('custom-element'));
4949
});
5050

5151
test('Dummy.svelte?raw&svelte&type=style', async () => {
5252
const result = await getText('#style');
53-
expect(result).toMatchFileSnapshot(snapshotFilename('style'));
53+
await expect(result).toMatchFileSnapshot(snapshotFilename('style'));
5454
});
5555

5656
test('Dummy.svelte?raw&svelte&type=all&sourcemap', async () => {
5757
const result = await getText('#all');
58-
expect(normalizeSnapshot(result)).toMatchFileSnapshot(snapshotFilename('all'));
58+
await expect(normalizeSnapshot(result)).toMatchFileSnapshot(snapshotFilename('all'));
5959
});
6060

6161
describe.runIf(!isBuild)('mixed exports', () => {
6262
test('Dummy.svelte?raw&svelte&type=preprocessed', async () => {
6363
const module = await fetchFromPage('src/Dummy.svelte?raw&svelte&type=preprocessed').then(
6464
(res) => res.text()
6565
);
66-
expect(normalizeSnapshot(module)).toMatchFileSnapshot(snapshotFilename('mixed-preprocessed'));
66+
await expect(normalizeSnapshot(module)).toMatchFileSnapshot(
67+
snapshotFilename('mixed-preprocessed')
68+
);
6769
});
6870
test('Dummy.svelte?raw&svelte&type=style', async () => {
6971
const module = await fetchFromPage('src/Dummy.svelte?raw&svelte&type=style').then((res) =>
7072
res.text()
7173
);
72-
expect(normalizeSnapshot(module)).toMatchFileSnapshot(snapshotFilename('mixed-style'));
74+
await expect(normalizeSnapshot(module)).toMatchFileSnapshot(snapshotFilename('mixed-style'));
7375
});
7476
test('Dummy.svelte?raw&svelte&type=script', async () => {
7577
const module = await fetchFromPage('src/Dummy.svelte?raw&svelte&type=script').then((res) =>
7678
res.text()
7779
);
78-
expect(normalizeSnapshot(module)).toMatchFileSnapshot(snapshotFilename('mixed-script'));
80+
await expect(normalizeSnapshot(module)).toMatchFileSnapshot(snapshotFilename('mixed-script'));
7981
});
8082
test('Dummy.svelte?raw&svelte&type=all', async () => {
8183
const module = await fetchFromPage('src/Dummy.svelte?raw&svelte&type=all').then((res) =>
8284
res.text()
8385
);
84-
expect(normalizeSnapshot(module)).toMatchFileSnapshot(snapshotFilename('mixed-all'));
86+
await expect(normalizeSnapshot(module)).toMatchFileSnapshot(snapshotFilename('mixed-all'));
8587
});
8688
});
8789
});
@@ -138,24 +140,26 @@ describe.runIf(!isBuild).skip('ssrLoadModule', () => {
138140

139141
test('?raw', async () => {
140142
const result = await ssrLoadDummy('?raw');
141-
expect(result).toMatchFileSnapshot(snapshotFilename('ssr-raw'));
143+
await expect(result).toMatchFileSnapshot(snapshotFilename('ssr-raw'));
142144
});
143145
test('?raw&svelte&type=preprocessed', async () => {
144146
const result = await ssrLoadDummy('?raw&svelte&type=preprocessed');
145-
expect(result).toMatchFileSnapshot(snapshotFilename('ssr-preprocessed'));
147+
await expect(result).toMatchFileSnapshot(snapshotFilename('ssr-preprocessed'));
146148
});
147149
test('?raw&svelte&type=script', async () => {
148150
const result = await ssrLoadDummy('?raw&svelte&type=script');
149-
expect(normalizeSnapshot(result)).toMatchFileSnapshot(snapshotFilename('ssr-script'));
151+
await expect(normalizeSnapshot(result)).toMatchFileSnapshot(snapshotFilename('ssr-script'));
150152
});
151153
test('?raw&svelte&type=script&compilerOptions={"customElement":true}', async () => {
152154
const result = await ssrLoadDummy(
153155
'?raw&svelte&type=script&compilerOptions={"customElement":true}'
154156
);
155-
expect(normalizeSnapshot(result)).toMatchFileSnapshot(snapshotFilename('ssr-custom-element'));
157+
await expect(normalizeSnapshot(result)).toMatchFileSnapshot(
158+
snapshotFilename('ssr-custom-element')
159+
);
156160
});
157161
test('?raw&svelte&type=style', async () => {
158162
const result = await ssrLoadDummy('?raw&svelte&type=style');
159-
expect(result).toMatchFileSnapshot(snapshotFilename('ssr-style'));
163+
await expect(result).toMatchFileSnapshot(snapshotFilename('ssr-style'));
160164
});
161165
});

packages/e2e-tests/kit-node/__tests__/kit.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,7 @@ describe('kit-node', () => {
309309
'svelte/transition',
310310
'svelte',
311311
'svelte/internal/disclose-version',
312+
'svelte/internal/flags/legacy',
312313
'svelte/legacy',
313314
'svelte-i18n > deepmerge',
314315
'svelte-i18n > cli-color',
@@ -336,6 +337,7 @@ describe('kit-node', () => {
336337
'svelte/transition',
337338
'svelte',
338339
'svelte/internal/disclose-version',
340+
'svelte/internal/flags/legacy',
339341
'svelte/internal/server',
340342
'svelte/server',
341343
'svelte/legacy'

0 commit comments

Comments
 (0)