File tree 2 files changed +12
-0
lines changed
2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,12 @@ describe("Features", () => {
16
16
view ( ) . should . equal ( "<h3>\n\t<error>Include not found: notfound</error>\n</h3>" ) ;
17
17
} ) ;
18
18
19
+ it ( "<% include %> used in compileData will use process cwd" , async ( ) => {
20
+ const view = await keikan . compileData ( "<% include label() %>" ) ;
21
+
22
+ view ( ) . should . equal ( "<error>Include not found: label</error>" ) ;
23
+ } ) ;
24
+
19
25
it ( "<%= %>, <%- %> and <%# %>" , async ( ) => {
20
26
const view = await keikan . compilePath ( import . meta. dirname + "/views/escaping" ) ;
21
27
Original file line number Diff line number Diff line change @@ -14,6 +14,12 @@ describe("Renderer", () => {
14
14
view . should . be . instanceOf ( Promise ) ;
15
15
} ) ;
16
16
17
+ it ( "compileData handles code" , async ( ) => {
18
+ const view = await keikan . compileData ( "<h3><% if (true) { %>hello world<% } %></h3>" ) ;
19
+
20
+ view ( ) . should . be . equal ( "<h3>hello world</h3>" ) ;
21
+ } ) ;
22
+
17
23
it ( "exposes a compilePath method" , ( ) => {
18
24
keikan . compilePath . should . be . of . type ( "function" ) ;
19
25
} ) ;
You can’t perform that action at this time.
0 commit comments