@@ -60,51 +60,51 @@ describe('@rollup-extras/plugin-angularjs-template-cache', () => {
6060 await ( pluginInstance as any ) . buildStart . apply ( rollupContextMock ) ;
6161 await ( pluginInstance as any ) . resolveId . call ( rollupContextMock , 'templates' ) ;
6262 await ( pluginInstance as any ) . load . call ( rollupContextMock , '\0templates:templates' ) ;
63- expect ( rollupContextMock . addWatchFile ) . toBeCalledWith ( 'aFolder/test.html' ) ;
64- expect ( rollupContextMock . addWatchFile ) . toBeCalledWith ( 'aFolder/test2.html' ) ;
65- expect ( glob ) . toBeCalledWith ( './**/*.html' ) ;
63+ expect ( rollupContextMock . addWatchFile ) . toHaveBeenCalledWith ( 'aFolder/test.html' ) ;
64+ expect ( rollupContextMock . addWatchFile ) . toHaveBeenCalledWith ( 'aFolder/test2.html' ) ;
65+ expect ( glob ) . toHaveBeenCalledWith ( './**/*.html' ) ;
6666 } ) ;
6767
6868 it ( 'custom - string' , async ( ) => {
6969 const pluginInstance = plugin ( './views/**/*.html' ) ;
7070 await ( pluginInstance as any ) . buildStart . apply ( rollupContextMock ) ;
7171 await ( pluginInstance as any ) . resolveId . call ( rollupContextMock , 'templates' ) ;
7272 await ( pluginInstance as any ) . load . call ( rollupContextMock , '\0templates:templates' ) ;
73- expect ( rollupContextMock . addWatchFile ) . toBeCalledWith ( 'aFolder/test.html' ) ;
74- expect ( rollupContextMock . addWatchFile ) . toBeCalledWith ( 'aFolder/test2.html' ) ;
75- expect ( glob ) . toBeCalledWith ( './views/**/*.html' ) ;
73+ expect ( rollupContextMock . addWatchFile ) . toHaveBeenCalledWith ( 'aFolder/test.html' ) ;
74+ expect ( rollupContextMock . addWatchFile ) . toHaveBeenCalledWith ( 'aFolder/test2.html' ) ;
75+ expect ( glob ) . toHaveBeenCalledWith ( './views/**/*.html' ) ;
7676 } ) ;
7777
7878 it ( 'custom - array' , async ( ) => {
7979 const pluginInstance = plugin ( [ './views/**/*.html' , './**/*.html' ] ) ;
8080 await ( pluginInstance as any ) . buildStart . apply ( rollupContextMock ) ;
8181 await ( pluginInstance as any ) . resolveId . call ( rollupContextMock , 'templates' ) ;
8282 await ( pluginInstance as any ) . load . call ( rollupContextMock , '\0templates:templates' ) ;
83- expect ( rollupContextMock . addWatchFile ) . toBeCalledWith ( 'aFolder/test.html' ) ;
84- expect ( rollupContextMock . addWatchFile ) . toBeCalledWith ( 'aFolder/test2.html' ) ;
85- expect ( glob ) . toBeCalledWith ( './views/**/*.html' ) ;
86- expect ( glob ) . toBeCalledWith ( './**/*.html' ) ;
83+ expect ( rollupContextMock . addWatchFile ) . toHaveBeenCalledWith ( 'aFolder/test.html' ) ;
84+ expect ( rollupContextMock . addWatchFile ) . toHaveBeenCalledWith ( 'aFolder/test2.html' ) ;
85+ expect ( glob ) . toHaveBeenCalledWith ( './views/**/*.html' ) ;
86+ expect ( glob ) . toHaveBeenCalledWith ( './**/*.html' ) ;
8787 } ) ;
8888
8989 it ( 'custom templates property - string' , async ( ) => {
9090 const pluginInstance = plugin ( { templates : './views/**/*.html' } ) ;
9191 await ( pluginInstance as any ) . buildStart . apply ( rollupContextMock ) ;
9292 await ( pluginInstance as any ) . resolveId . call ( rollupContextMock , 'templates' ) ;
9393 await ( pluginInstance as any ) . load . call ( rollupContextMock , '\0templates:templates' ) ;
94- expect ( rollupContextMock . addWatchFile ) . toBeCalledWith ( 'aFolder/test.html' ) ;
95- expect ( rollupContextMock . addWatchFile ) . toBeCalledWith ( 'aFolder/test2.html' ) ;
96- expect ( glob ) . toBeCalledWith ( './views/**/*.html' ) ;
94+ expect ( rollupContextMock . addWatchFile ) . toHaveBeenCalledWith ( 'aFolder/test.html' ) ;
95+ expect ( rollupContextMock . addWatchFile ) . toHaveBeenCalledWith ( 'aFolder/test2.html' ) ;
96+ expect ( glob ) . toHaveBeenCalledWith ( './views/**/*.html' ) ;
9797 } ) ;
9898
9999 it ( 'custom templates property - array' , async ( ) => {
100100 const pluginInstance = plugin ( { templates : [ './views/**/*.html' , './**/*.html' ] } ) ;
101101 await ( pluginInstance as any ) . buildStart . apply ( rollupContextMock ) ;
102102 await ( pluginInstance as any ) . resolveId . call ( rollupContextMock , 'templates' ) ;
103103 await ( pluginInstance as any ) . load . call ( rollupContextMock , '\0templates:templates' ) ;
104- expect ( rollupContextMock . addWatchFile ) . toBeCalledWith ( 'aFolder/test.html' ) ;
105- expect ( rollupContextMock . addWatchFile ) . toBeCalledWith ( 'aFolder/test2.html' ) ;
106- expect ( glob ) . toBeCalledWith ( './views/**/*.html' ) ;
107- expect ( glob ) . toBeCalledWith ( './**/*.html' ) ;
104+ expect ( rollupContextMock . addWatchFile ) . toHaveBeenCalledWith ( 'aFolder/test.html' ) ;
105+ expect ( rollupContextMock . addWatchFile ) . toHaveBeenCalledWith ( 'aFolder/test2.html' ) ;
106+ expect ( glob ) . toHaveBeenCalledWith ( './views/**/*.html' ) ;
107+ expect ( glob ) . toHaveBeenCalledWith ( './**/*.html' ) ;
108108 } ) ;
109109
110110 it ( '!isFile' , async ( ) => {
@@ -145,8 +145,8 @@ describe('@rollup-extras/plugin-angularjs-template-cache', () => {
145145 await ( pluginInstance as any ) . resolveId . call ( rollupContextMock , 'templates' ) ;
146146 const result = await ( pluginInstance as any ) . load . call ( rollupContextMock , '\0templates:templates' ) ;
147147 expect ( result . includes ( '$templateCache.put("id", "<html></html>");' ) ) . toBe ( true ) ;
148- expect ( transformTemplateUri ) . toBeCalledWith ( 'aFolder/test.html' ) ;
149- expect ( transformTemplateUri ) . toBeCalledWith ( 'aFolder/test2.html' ) ;
148+ expect ( transformTemplateUri ) . toHaveBeenCalledWith ( 'aFolder/test.html' ) ;
149+ expect ( transformTemplateUri ) . toHaveBeenCalledWith ( 'aFolder/test2.html' ) ;
150150 } ) ;
151151 } ) ;
152152
@@ -158,7 +158,7 @@ describe('@rollup-extras/plugin-angularjs-template-cache', () => {
158158 const result = await ( pluginInstance as any ) . load . call ( rollupContextMock , '\0templates:templates' ) ;
159159 expect ( result . includes ( '$templateCache.put("aFolder/test.html", "some text");' ) ) . toBe ( true ) ;
160160 expect ( result . includes ( '$templateCache.put("aFolder/test2.html", "some text");' ) ) . toBe ( true ) ;
161- expect ( processHtml ) . toBeCalledWith ( '<html></html>' ) ;
161+ expect ( processHtml ) . toHaveBeenCalledWith ( '<html></html>' ) ;
162162 expect ( processHtml ) . toBeCalledTimes ( 2 ) ;
163163 } ) ;
164164
@@ -212,17 +212,17 @@ describe('@rollup-extras/plugin-angularjs-template-cache', () => {
212212 await ( pluginInstance as any ) . buildStart . call ( rollupContextMock ) ;
213213 await ( pluginInstance as any ) . resolveId . call ( rollupContextMock , 'templates' ) ;
214214 await ( pluginInstance as any ) . load . call ( rollupContextMock , '\0templates:templates' ) ;
215- expect ( rollupContextMock . addWatchFile ) . toBeCalledWith ( 'aFolder/test.html' ) ;
216- expect ( rollupContextMock . addWatchFile ) . toBeCalledWith ( 'aFolder/test2.html' ) ;
215+ expect ( rollupContextMock . addWatchFile ) . toHaveBeenCalledWith ( 'aFolder/test.html' ) ;
216+ expect ( rollupContextMock . addWatchFile ) . toHaveBeenCalledWith ( 'aFolder/test2.html' ) ;
217217 } ) ;
218218
219219 it ( 'off' , async ( ) => {
220220 const pluginInstance = plugin ( { watch : false } ) ;
221221 await ( pluginInstance as any ) . buildStart . call ( rollupContextMock ) ;
222222 await ( pluginInstance as any ) . resolveId . call ( rollupContextMock , 'templates' ) ;
223223 await ( pluginInstance as any ) . load . call ( rollupContextMock , '\0templates:templates' ) ;
224- expect ( rollupContextMock . addWatchFile ) . not . toBeCalledWith ( 'aFolder/test.html' ) ;
225- expect ( rollupContextMock . addWatchFile ) . not . toBeCalledWith ( 'aFolder/test2.html' ) ;
224+ expect ( rollupContextMock . addWatchFile ) . not . toHaveBeenCalledWith ( 'aFolder/test.html' ) ;
225+ expect ( rollupContextMock . addWatchFile ) . not . toHaveBeenCalledWith ( 'aFolder/test2.html' ) ;
226226 } ) ;
227227 } ) ;
228228
@@ -234,7 +234,7 @@ describe('@rollup-extras/plugin-angularjs-template-cache', () => {
234234 await ( pluginInstance as any ) . load . call ( rollupContextMock , '\0templates:templates' ) ;
235235 expect ( createLogger ) . lastCalledWith ( '@rollup-extras/plugin-angularjs-template-cache' ) ;
236236 expect ( loggerStart ) . lastCalledWith ( 'inlining templates' , LogLevel . verbose ) ;
237- expect ( loggerFinish ) . toBeCalledWith ( 'inlined aFolder/test.html, aFolder/test2.html' ) ;
237+ expect ( loggerFinish ) . toHaveBeenCalledWith ( 'inlined aFolder/test.html, aFolder/test2.html' ) ;
238238 } ) ;
239239
240240 it ( 'more than 5 templates' , async ( ) => {
@@ -246,7 +246,7 @@ describe('@rollup-extras/plugin-angularjs-template-cache', () => {
246246 await ( pluginInstance as any ) . load . call ( rollupContextMock , '\0templates:templates' ) ;
247247 expect ( createLogger ) . lastCalledWith ( '@rollup-extras/plugin-angularjs-template-cache' ) ;
248248 expect ( loggerStart ) . lastCalledWith ( 'inlining templates' , LogLevel . verbose ) ;
249- expect ( loggerFinish ) . toBeCalledWith ( 'inlined 6 templates' ) ;
249+ expect ( loggerFinish ) . toHaveBeenCalledWith ( 'inlined 6 templates' ) ;
250250 } ) ;
251251
252252 it ( 'true' , async ( ) => {
@@ -262,8 +262,8 @@ describe('@rollup-extras/plugin-angularjs-template-cache', () => {
262262 await ( pluginInstance as any ) . buildStart . call ( rollupContextMock ) ;
263263 await ( pluginInstance as any ) . resolveId . call ( rollupContextMock , 'templates' ) ;
264264 await ( pluginInstance as any ) . load . call ( rollupContextMock , '\0templates:templates' ) ;
265- expect ( logger ) . toBeCalledWith ( '\taFolder/test.html → aFolder/test.html' , LogLevel . info ) ;
266- expect ( logger ) . toBeCalledWith ( '\taFolder/test2.html → aFolder/test2.html' , LogLevel . info ) ;
265+ expect ( logger ) . toHaveBeenCalledWith ( '\taFolder/test.html → aFolder/test.html' , LogLevel . info ) ;
266+ expect ( logger ) . toHaveBeenCalledWith ( '\taFolder/test2.html → aFolder/test2.html' , LogLevel . info ) ;
267267 } ) ;
268268
269269 it ( 'exception' , async ( ) => {
@@ -273,7 +273,7 @@ describe('@rollup-extras/plugin-angularjs-template-cache', () => {
273273 await ( pluginInstance as any ) . buildStart . call ( rollupContextMock ) ;
274274 await ( pluginInstance as any ) . resolveId . call ( rollupContextMock , 'templates' ) ;
275275 await ( pluginInstance as any ) . load . call ( rollupContextMock , '\0templates:templates' ) ;
276- expect ( logger ) . toBeCalledWith ( 'error reading file aFolder/test.html' , LogLevel . warn , expect . objectContaining ( { stack : '' } ) ) ;
276+ expect ( logger ) . toHaveBeenCalledWith ( 'error reading file aFolder/test.html' , LogLevel . warn , expect . objectContaining ( { stack : '' } ) ) ;
277277 } ) ;
278278
279279 it ( 'missing directory exception' , async ( ) => {
@@ -283,7 +283,7 @@ describe('@rollup-extras/plugin-angularjs-template-cache', () => {
283283 await ( pluginInstance as any ) . buildStart . call ( rollupContextMock ) ;
284284 await ( pluginInstance as any ) . resolveId . call ( rollupContextMock , 'templates' ) ;
285285 await ( pluginInstance as any ) . load . call ( rollupContextMock , '\0templates:templates' ) ;
286- expect ( logger ) . toBeCalledWith ( 'error reading file aFolder/test.html' , undefined , expect . objectContaining ( { code : 'ENOENT' , stack : '' } ) ) ;
286+ expect ( logger ) . toHaveBeenCalledWith ( 'error reading file aFolder/test.html' , undefined , expect . objectContaining ( { code : 'ENOENT' , stack : '' } ) ) ;
287287 } ) ;
288288 } ) ;
289289
@@ -299,7 +299,7 @@ describe('@rollup-extras/plugin-angularjs-template-cache', () => {
299299 it ( 'autoImport - emits entry point' , async ( ) => {
300300 const pluginInstance = plugin ( { autoImport : true } ) ;
301301 await ( pluginInstance as any ) . buildStart . call ( rollupContextMock ) ;
302- expect ( rollupContextMock . emitFile ) . toBeCalledWith ( { id : '\0templates:templates' , type : 'chunk' } ) ;
302+ expect ( rollupContextMock . emitFile ) . toHaveBeenCalledWith ( { id : '\0templates:templates' , type : 'chunk' } ) ;
303303 await ( pluginInstance as any ) . resolveId . call ( rollupContextMock , 'templates' ) ;
304304 await ( pluginInstance as any ) . load . call ( rollupContextMock , '\0templates:templates' ) ;
305305 } ) ;
0 commit comments