From 163916c19b3bd79c0c17fc8bbff3fdc26815910a Mon Sep 17 00:00:00 2001 From: Marsel Shaikhin Date: Wed, 27 Nov 2024 22:26:46 +0100 Subject: [PATCH] test: fix tests by removing unnecessary quotes --- crates/fervid/src/lib.rs | 2 ++ crates/fervid_codegen/src/builtins/component.rs | 4 ++-- crates/fervid_codegen/src/builtins/suspense.rs | 4 ++-- crates/fervid_codegen/src/builtins/transition.rs | 4 ++-- .../fervid_codegen/src/builtins/transition_group.rs | 4 ++-- crates/fervid_codegen/src/components/mod.rs | 12 ++++++------ 6 files changed, 16 insertions(+), 14 deletions(-) diff --git a/crates/fervid/src/lib.rs b/crates/fervid/src/lib.rs index 6920bcd..cf83333 100644 --- a/crates/fervid/src/lib.rs +++ b/crates/fervid/src/lib.rs @@ -22,6 +22,8 @@ //! let mut transform_errors = Vec::new(); //! let transform_options = fervid_transform::TransformSfcOptions { //! is_prod: true, +//! is_ce: false, +//! props_destructure: fervid_transform::PropsDestructureConfig::default(), //! scope_id: "filehash", //! filename: "input.vue" //! }; diff --git a/crates/fervid_codegen/src/builtins/component.rs b/crates/fervid_codegen/src/builtins/component.rs index 9757479..96a79c2 100644 --- a/crates/fervid_codegen/src/builtins/component.rs +++ b/crates/fervid_codegen/src/builtins/component.rs @@ -212,7 +212,7 @@ mod tests { patch_hints: Default::default(), span: DUMMY_SP, }, - r#"(_openBlock(),_createBlock(_resolveDynamicComponent("div"),null,{"default":_withCtx(()=>[_createTextVNode("foobar")]),_:1}))"#, + r#"(_openBlock(),_createBlock(_resolveDynamicComponent("div"),null,{default:_withCtx(()=>[_createTextVNode("foobar")]),_:1}))"#, ) } @@ -300,7 +300,7 @@ mod tests { patch_hints: Default::default(), span: DUMMY_SP, }, - r#"(_openBlock(),_createBlock(_resolveDynamicComponent("div"),{foo:"bar",baz:qux},{named:_withCtx(()=>[_createTextVNode("bazqux")]),"default":_withCtx(()=>[_createTextVNode("foobar")]),_:1}))"#, + r#"(_openBlock(),_createBlock(_resolveDynamicComponent("div"),{foo:"bar",baz:qux},{named:_withCtx(()=>[_createTextVNode("bazqux")]),default:_withCtx(()=>[_createTextVNode("foobar")]),_:1}))"#, ) } diff --git a/crates/fervid_codegen/src/builtins/suspense.rs b/crates/fervid_codegen/src/builtins/suspense.rs index bbd6d81..5f387a4 100644 --- a/crates/fervid_codegen/src/builtins/suspense.rs +++ b/crates/fervid_codegen/src/builtins/suspense.rs @@ -100,7 +100,7 @@ mod tests { patch_hints: Default::default(), span: DUMMY_SP, }, - r#"(_openBlock(),_createBlock(_Suspense,null,{"default":_withCtx(()=>[_createTextVNode("foobar")]),_:1}))"#, + r#"(_openBlock(),_createBlock(_Suspense,null,{default:_withCtx(()=>[_createTextVNode("foobar")]),_:1}))"#, ) } @@ -123,7 +123,7 @@ mod tests { patch_hints: Default::default(), span: DUMMY_SP, }, - r#"(_openBlock(),_createBlock(_Suspense,{foo:"bar",baz:qux},{"default":_withCtx(()=>[_createTextVNode("foobar")]),_:1}))"#, + r#"(_openBlock(),_createBlock(_Suspense,{foo:"bar",baz:qux},{default:_withCtx(()=>[_createTextVNode("foobar")]),_:1}))"#, ) } diff --git a/crates/fervid_codegen/src/builtins/transition.rs b/crates/fervid_codegen/src/builtins/transition.rs index a86cb59..7aa3741 100644 --- a/crates/fervid_codegen/src/builtins/transition.rs +++ b/crates/fervid_codegen/src/builtins/transition.rs @@ -99,7 +99,7 @@ mod tests { patch_hints: Default::default(), span: DUMMY_SP, }, - r#"_createVNode(_Transition,null,{"default":_withCtx(()=>[_createTextVNode("foobar")]),_:1})"#, + r#"_createVNode(_Transition,null,{default:_withCtx(()=>[_createTextVNode("foobar")]),_:1})"#, ) } @@ -122,7 +122,7 @@ mod tests { patch_hints: Default::default(), span: DUMMY_SP, }, - r#"_createVNode(_Transition,{foo:"bar",baz:qux},{"default":_withCtx(()=>[_createTextVNode("foobar")]),_:1})"#, + r#"_createVNode(_Transition,{foo:"bar",baz:qux},{default:_withCtx(()=>[_createTextVNode("foobar")]),_:1})"#, ) } diff --git a/crates/fervid_codegen/src/builtins/transition_group.rs b/crates/fervid_codegen/src/builtins/transition_group.rs index 1665b3a..5669023 100644 --- a/crates/fervid_codegen/src/builtins/transition_group.rs +++ b/crates/fervid_codegen/src/builtins/transition_group.rs @@ -99,7 +99,7 @@ mod tests { patch_hints: Default::default(), span: DUMMY_SP, }, - r#"_createVNode(_TransitionGroup,null,{"default":_withCtx(()=>[_createTextVNode("foobar")]),_:1})"#, + r#"_createVNode(_TransitionGroup,null,{default:_withCtx(()=>[_createTextVNode("foobar")]),_:1})"#, ) } @@ -122,7 +122,7 @@ mod tests { patch_hints: Default::default(), span: DUMMY_SP, }, - r#"_createVNode(_TransitionGroup,{foo:"bar",baz:qux},{"default":_withCtx(()=>[_createTextVNode("foobar")]),_:1})"#, + r#"_createVNode(_TransitionGroup,{foo:"bar",baz:qux},{default:_withCtx(()=>[_createTextVNode("foobar")]),_:1})"#, ) } diff --git a/crates/fervid_codegen/src/components/mod.rs b/crates/fervid_codegen/src/components/mod.rs index af93287..12cb277 100644 --- a/crates/fervid_codegen/src/components/mod.rs +++ b/crates/fervid_codegen/src/components/mod.rs @@ -739,7 +739,7 @@ mod tests { patch_hints: Default::default(), span: DUMMY_SP, }, - r#"_createVNode(_component_test_component,null,{"default":_withCtx(()=>[_createTextVNode("hello from component"),_createElementVNode("div",null,"hello from div")])})"#, + r#"_createVNode(_component_test_component,null,{default:_withCtx(()=>[_createTextVNode("hello from component"),_createElementVNode("div",null,"hello from div")])})"#, false, ); @@ -790,7 +790,7 @@ mod tests { patch_hints: Default::default(), span: DUMMY_SP, }, - r#"_createVNode(_component_test_component,null,{"default":_withCtx(()=>[_createTextVNode("hello from component"),_createElementVNode("div",null,"hello from div")])})"#, + r#"_createVNode(_component_test_component,null,{default:_withCtx(()=>[_createTextVNode("hello from component"),_createElementVNode("div",null,"hello from div")])})"#, false, ); } @@ -983,7 +983,7 @@ mod tests { patch_hints: Default::default(), span: DUMMY_SP, }, - r#"_createVNode(_component_test_component,null,{"foo-bar":_withCtx(()=>[_createTextVNode("hello from slot")]),"default":_withCtx(()=>[_createTextVNode("hello from component"),_createElementVNode("div",null,"hello from div")])})"#, + r#"_createVNode(_component_test_component,null,{"foo-bar":_withCtx(()=>[_createTextVNode("hello from slot")]),default:_withCtx(()=>[_createTextVNode("hello from component"),_createElementVNode("div",null,"hello from div")])})"#, false, ); @@ -1055,7 +1055,7 @@ mod tests { patch_hints: Default::default(), span: DUMMY_SP, }, - r#"_createVNode(_component_test_component,null,{"default":_withCtx(()=>[_createTextVNode("hello from default"),_createElementVNode("div",null,"hello from div")]),"foo-bar":_withCtx(()=>[_createTextVNode("hello from slot")])})"#, + r#"_createVNode(_component_test_component,null,{default:_withCtx(()=>[_createTextVNode("hello from default"),_createElementVNode("div",null,"hello from div")]),"foo-bar":_withCtx(()=>[_createTextVNode("hello from slot")])})"#, false, ); @@ -1108,7 +1108,7 @@ mod tests { patch_hints: Default::default(), span: DUMMY_SP, }, - r#"_createVNode(_component_test_component,null,{"foo-bar":_withCtx(()=>[_createTextVNode("hello from slot")]),"default":_withCtx(()=>[_createTextVNode("hello from component"),_createElementVNode("div",null,"hello from div")])})"#, + r#"_createVNode(_component_test_component,null,{"foo-bar":_withCtx(()=>[_createTextVNode("hello from slot")]),default:_withCtx(()=>[_createTextVNode("hello from component"),_createElementVNode("div",null,"hello from div")])})"#, false, ); } @@ -1202,7 +1202,7 @@ mod tests { patch_hints: Default::default(), span: DUMMY_SP, }, - r#"_createVNode(_component_test_component,null,{"foo-bar":_withCtx(()=>[_createTextVNode("hello from slot")]),"default":_withCtx(()=>[_createTextVNode("hello from default"),_createElementVNode("div",null,"hello from div")]),baz:_withCtx(()=>[_createTextVNode("hello from baz")])})"#, + r#"_createVNode(_component_test_component,null,{"foo-bar":_withCtx(()=>[_createTextVNode("hello from slot")]),default:_withCtx(()=>[_createTextVNode("hello from default"),_createElementVNode("div",null,"hello from div")]),baz:_withCtx(()=>[_createTextVNode("hello from baz")])})"#, false, ); }