@@ -61,20 +61,17 @@ describe("Kire Native Directives", () => {
6161
6262 describe ( "Loops" , ( ) => {
6363 it ( "@for with array of" , async ( ) => {
64- const tpl = `@for(item of it.items){{ item }},
65- @end` ;
64+ const tpl = `@for(item of it.items){{ item }},@end` ;
6665 expect ( await render ( tpl , { items : [ 1 , 2 , 3 ] } ) ) . toBe ( "1,2,3," ) ;
6766 } ) ;
6867
6968 it ( "@for with empty array" , async ( ) => {
70- const tpl = `@for(item of it.items){{ item }},
71- @end` ;
69+ const tpl = `@for(item of it.items){{ item }},@end` ;
7270 expect ( await render ( tpl , { items : [ ] } ) ) . toBe ( "" ) ;
7371 } ) ;
7472
7573 it ( "@for with object properties (for...in equivalent)" , async ( ) => {
76- const tpl = `@for(key in it.obj){{ key }}:{{ it.obj[key] }},
77- @end` ;
74+ const tpl = `@for(key in it.obj){{ key }}:{{ it.obj[key] }},@end` ;
7875 expect ( await render ( tpl , { obj : { a : 1 , b : 2 } } ) ) . toBe ( "a:1,b:2," ) ;
7976 } ) ;
8077 } ) ;
@@ -230,11 +227,10 @@ describe("Kire Component Directives", () => {
230227describe ( "Kire Include Directive" , ( ) => {
231228 const kire = new Kire ( ) ;
232229 kire . resolverFn = async ( path ) => {
233- if ( path . includes ( "child" ) ) return `Child: {{ it.name }}` ;
234- if ( path . includes ( "wrapper" ) ) return `Wrapper: {{ it.content }}` ;
235- if ( path . includes ( "grandchild" ) )
230+ if ( path === "child.kire" ) return `Child: {{ it.name }}` ;
231+ if ( path === "grandchild.kire" )
236232 return `Grandchild: {{ it.item.name }} and {{ it.item.value }}` ;
237- if ( path . includes ( "nested" ) )
233+ if ( path === "nested.kire" )
238234 return `@include('grandchild', { item: it.n_item })` ;
239235 return null ;
240236 } ;
@@ -245,14 +241,9 @@ describe("Kire Include Directive", () => {
245241 expect ( await render ( tpl ) ) . toBe ( "Child: Test" ) ;
246242 } ) ;
247243
248- it ( "@include with content block" , async ( ) => {
249- const tpl = `@include('wrapper')Inner@end` ;
250- expect ( await render ( tpl ) ) . toBe ( "Wrapper: Inner" ) ;
251- } ) ;
252-
253244 it ( "@include with non-existent path" , async ( ) => {
254245 const tpl = `Start @include('nonexistent') End` ;
255- expect ( await render ( tpl ) ) . toBe ( "Start End" ) ;
246+ expect ( await render ( tpl ) ) . toBe ( "Start End" ) ;
256247 } ) ;
257248
258249 it ( "@include with nested includes" , async ( ) => {
0 commit comments