@@ -27,6 +27,17 @@ function stage1Tests(transform: (code: string) => string) {
27
27
expect ( code ) . toMatch ( / r e t u r n h b s \( " < d i v / ) ;
28
28
expect ( code ) . toMatch ( / e m b r o i d e r - s a m p l e - t r a n s f o r m s - r e s u l t / ) ;
29
29
} ) ;
30
+ test ( 'call form with template literal' , ( ) => {
31
+ let code = transform ( `
32
+ import hbs from 'htmlbars-inline-precompile';
33
+ export default function() {
34
+ return hbs(\`<div class={{embroider-sample-transforms-target}}></div>\`);
35
+ }
36
+ ` ) ;
37
+ expect ( code ) . toMatch ( / i m p o r t h b s f r o m ' h t m l b a r s - i n l i n e - p r e c o m p i l e ' / ) ;
38
+ expect ( code ) . toMatch ( / r e t u r n h b s \( " < d i v / ) ;
39
+ expect ( code ) . toMatch ( / e m b r o i d e r - s a m p l e - t r a n s f o r m s - r e s u l t / ) ;
40
+ } ) ;
30
41
31
42
test ( 'runtime errors are left in place in stage 1' , ( ) => {
32
43
let code = transform ( `
@@ -63,6 +74,17 @@ function stage3Tests(transform: (code: string) => string) {
63
74
expect ( code ) . toMatch ( / i m p o r t { c r e a t e T e m p l a t e F a c t o r y } f r o m [ ' " ] @ e m b e r \/ t e m p l a t e - f a c t o r y [ ' " ] / ) ;
64
75
expect ( code ) . toMatch ( / r e t u r n c r e a t e T e m p l a t e F a c t o r y \( { / ) ;
65
76
} ) ;
77
+ test ( 'call form with template literal' , ( ) => {
78
+ let code = transform ( `
79
+ import hbs from 'htmlbars-inline-precompile';
80
+ export default function() {
81
+ return hbs(\`<div class={{embroider-sample-transforms-target}}></div>\`);
82
+ }
83
+ ` ) ;
84
+ expect ( code ) . not . toMatch ( / i m p o r t h b s f r o m ' h t m l b a r s - i n l i n e - p r e c o m p i l e ' / ) ;
85
+ expect ( code ) . toMatch ( / i m p o r t { c r e a t e T e m p l a t e F a c t o r y } f r o m [ ' " ] @ e m b e r \/ t e m p l a t e - f a c t o r y [ ' " ] / ) ;
86
+ expect ( code ) . toMatch ( / r e t u r n c r e a t e T e m p l a t e F a c t o r y \( { / ) ;
87
+ } ) ;
66
88
test ( 'runtime errors become exceptions in stage 3' , ( ) => {
67
89
let code = transform ( `
68
90
import hbs from 'htmlbars-inline-precompile';
0 commit comments