Skip to content

Commit da8e10a

Browse files
committed
chore: fix tests
1 parent 816737b commit da8e10a

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

packages/e2e-tests/_test_dependencies/vite-plugins/index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,19 @@ export function transformValidation() {
1111
enforce: 'pre',
1212
transform(code, id) {
1313
if (id.endsWith('.svelte')) {
14-
return code.replace('__JS_TRANSFORM_1__', '__JS_TRANSFORM_2__');
14+
return code.replaceAll('__JS_TRANSFORM_1__', '__JS_TRANSFORM_2__');
1515
} else if (id.endsWith('.css')) {
16-
return code.replace('__CSS_TRANSFORM_1__', '__CSS_TRANSFORM_2__');
16+
return code.replaceAll('__CSS_TRANSFORM_1__', '__CSS_TRANSFORM_2__');
1717
}
1818
}
1919
},
2020
{
2121
name: 'transform-validation:2',
2222
transform(code, id) {
2323
if (id.endsWith('.svelte')) {
24-
return code.replace('__JS_TRANSFORM_2__', '__JS_TRANSFORM_3__');
24+
return code.replaceAll('__JS_TRANSFORM_2__', '__JS_TRANSFORM_3__');
2525
} else if (id.endsWith('.css')) {
26-
return code.replace('__CSS_TRANSFORM_2__', 'red');
26+
return code.replaceAll('__CSS_TRANSFORM_2__', 'red');
2727
}
2828
}
2929
},
@@ -32,7 +32,7 @@ export function transformValidation() {
3232
enforce: 'post',
3333
transform(code, id) {
3434
if (id.endsWith('.svelte')) {
35-
return code.replace('__JS_TRANSFORM_3__', 'Hello world');
35+
return code.replaceAll('__JS_TRANSFORM_3__', 'Hello world');
3636
}
3737
// can't handle css here as in build, it would be `export default {}`
3838
}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,8 @@
491491
"sources": [
492492
"Dummy.svelte"
493493
]
494-
}
494+
},
495+
"hasGlobal": false
495496
},
496497
"dependencies": [],
497498
"js": {

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,5 +1,5 @@
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","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,"tracing":null},"declarations":{},"declarators":{},"references":{},"function_depth":1,"tracing":null},"declarations":{},"declarators":{},"references":{},"function_depth":2,"tracing":null},"declarations":{},"declarators":{},"references":{},"function_depth":3,"tracing":null},"declarations":{},"declarators":{},"references":{},"function_depth":4,"tracing":null},"declarations":{},"declarators":{},"references":{},"function_depth":5,"tracing":null}}},"modifiers":[]},{"type":"Attribute","start":-1,"end":-1,"name":"class","value":[{"type":"Text","data":"","raw":"","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":43,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":24}},"name":"name"},"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}}}
2-
export const css={"code":"button.svelte-d8vj6a {\n color: #000099;\n}","map":{"version":3,"file":"Dummy.svelte","mappings":"AAWkB","names":[],"ignoreList":[],"sources":["Dummy.svelte"]}}
2+
export const css={"code":"button.svelte-d8vj6a {\n color: #000099;\n}","map":{"version":3,"file":"Dummy.svelte","mappings":"AAWkB","names":[],"ignoreList":[],"sources":["Dummy.svelte"]},"hasGlobal":false}
33
export const dependencies=[]
44
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_source(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,oBAAG,CAAC;;;;;6CAMV,IAAI,0BAAW,MAAM;;gCAFT;WACf,MAAM;CACP,CAAC","names":[],"ignoreList":[],"sources":["Dummy.svelte"]}}
55
export const lang="ts"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
export const code="button.svelte-d8vj6a {\n color: #000099;\n}"
2+
export const hasGlobal=false
23
export const map={"version":3,"file":"Dummy.svelte","mappings":"AAWkB","names":[],"ignoreList":[],"sources":["Dummy.svelte"]}
34
export default code

0 commit comments

Comments
 (0)