@@ -12,7 +12,7 @@ describe('gulp-angular-templatecache', function () {
1212 stream . on ( 'data' , function ( file ) {
1313 assert . equal ( path . normalize ( file . path ) , path . normalize ( __dirname + '/templates.js' ) ) ;
1414 assert . equal ( file . relative , 'templates.js' ) ;
15- assert . equal ( file . contents . toString ( 'utf8' ) , 'angular.module(" templates" ).run([" $templateCache" , function($templateCache) {$templateCache.put(" /template-a.html"," <h1 id=\\ "template-a\\ ">I\\\'m template A!</h1>" );\n$templateCache.put(" /template-b.html"," <h1 id=\\ "template-b\\ ">I\\\'m template B!</h1>" );}]);' ) ;
15+ assert . equal ( file . contents . toString ( 'utf8' ) , 'angular.module(\' templates\' ).run([\' $templateCache\' , function($templateCache) {$templateCache.put(\' /template-a.html\',\' <h1 id="template-a">I\\\'m template A!</h1>\' );\n$templateCache.put(\' /template-b.html\',\' <h1 id="template-b">I\\\'m template B!</h1>\' );}]);' ) ;
1616 cb ( ) ;
1717 } ) ;
1818
@@ -40,7 +40,7 @@ describe('gulp-angular-templatecache', function () {
4040 stream . on ( 'data' , function ( file ) {
4141 assert . equal ( path . normalize ( file . path ) , path . normalize ( __dirname + '/templates.js' ) ) ;
4242 assert . equal ( file . relative , 'templates.js' ) ;
43- assert . equal ( file . contents . toString ( 'utf8' ) , 'angular.module(" templates" , []).run([" $templateCache" , function($templateCache) {$templateCache.put(" /views/template-a.html"," <h1 id=\\ "template-a\\ ">I\\\'m template A!</h1>" );}]);' ) ;
43+ assert . equal ( file . contents . toString ( 'utf8' ) , 'angular.module(\' templates\' , []).run([\' $templateCache\' , function($templateCache) {$templateCache.put(\' /views/template-a.html\',\' <h1 id="template-a">I\\\'m template A!</h1>\' );}]);' ) ;
4444 cb ( ) ;
4545 } ) ;
4646
@@ -64,7 +64,7 @@ describe('gulp-angular-templatecache', function () {
6464 stream . on ( 'data' , function ( file ) {
6565 assert . equal ( path . normalize ( file . path ) , path . normalize ( __dirname + '/templates.js' ) ) ;
6666 assert . equal ( file . relative , 'templates.js' ) ;
67- assert . equal ( file . contents . toString ( 'utf8' ) , 'angular.module(" templates" ).run([" $templateCache" , function($templateCache) {$templateCache.put(" /views/template-a.html"," <h1 id=\\ "template-a\\ ">I\\\'m template A!</h1>" );}]);' ) ;
67+ assert . equal ( file . contents . toString ( 'utf8' ) , 'angular.module(\' templates\' ).run([\' $templateCache\' , function($templateCache) {$templateCache.put(\' /views/template-a.html\',\' <h1 id="template-a">I\\\'m template A!</h1>\' );}]);' ) ;
6868 cb ( ) ;
6969 } ) ;
7070
@@ -85,7 +85,7 @@ describe('gulp-angular-templatecache', function () {
8585 stream . on ( 'data' , function ( file ) {
8686 assert . equal ( path . normalize ( file . path ) , path . normalize ( __dirname + '/templates.js' ) ) ;
8787 assert . equal ( file . relative , 'templates.js' ) ;
88- assert . equal ( file . contents . toString ( 'utf8' ) , 'angular.module(" templates" ).run([" $templateCache" , function($templateCache) {$templateCache.put(" ./template-a.html"," <h1 id=\\ "template-a\\ ">I\\\'m template A!</h1>" );}]);' ) ;
88+ assert . equal ( file . contents . toString ( 'utf8' ) , 'angular.module(\' templates\' ).run([\' $templateCache\' , function($templateCache) {$templateCache.put(\' ./template-a.html\',\' <h1 id="template-a">I\\\'m template A!</h1>\' );}]);' ) ;
8989 cb ( ) ;
9090 } ) ;
9191
@@ -106,7 +106,7 @@ describe('gulp-angular-templatecache', function () {
106106 stream . on ( 'data' , function ( file ) {
107107 assert . equal ( path . normalize ( file . path ) , path . normalize ( __dirname + '/templates.js' ) ) ;
108108 assert . equal ( file . relative , 'templates.js' ) ;
109- assert . equal ( file . contents . toString ( 'utf8' ) , 'angular.module(" templates" ).run([" $templateCache" , function($templateCache) {$templateCache.put(" ./template-a.html"," <h1 id=\\ "template-a\\ ">I\\\'m template A!</h1>" );}]);' ) ;
109+ assert . equal ( file . contents . toString ( 'utf8' ) , 'angular.module(\' templates\' ).run([\' $templateCache\' , function($templateCache) {$templateCache.put(\' ./template-a.html\',\' <h1 id="template-a">I\\\'m template A!</h1>\' );}]);' ) ;
110110 cb ( ) ;
111111 } ) ;
112112
@@ -127,7 +127,7 @@ describe('gulp-angular-templatecache', function () {
127127 stream . on ( 'data' , function ( file ) {
128128 assert . equal ( path . normalize ( file . path ) , path . normalize ( __dirname + '/templates.js' ) ) ;
129129 assert . equal ( file . relative , 'templates.js' ) ;
130- assert . equal ( file . contents . toString ( 'utf8' ) , 'angular.module(" templates" ).run([" $templateCache" , function($templateCache) {$templateCache.put(" .root/template-a.html"," <h1 id=\\ "template-a\\ ">I\\\'m template A!</h1>" );}]);' ) ;
130+ assert . equal ( file . contents . toString ( 'utf8' ) , 'angular.module(\' templates\' ).run([\' $templateCache\' , function($templateCache) {$templateCache.put(\' .root/template-a.html\',\' <h1 id="template-a">I\\\'m template A!</h1>\' );}]);' ) ;
131131 cb ( ) ;
132132 } ) ;
133133
@@ -147,15 +147,15 @@ describe('gulp-angular-templatecache', function () {
147147
148148 it ( 'should change the URL to the output of the function' , function ( cb ) {
149149 var stream = templateCache ( 'templates.js' , {
150- transformUrl : function ( url ) {
150+ transformUrl : function ( url ) {
151151 return url . replace ( / t e m p l a t e / , 'tpl' ) ;
152152 }
153153 } ) ;
154154
155155 stream . on ( 'data' , function ( file ) {
156156 assert . equal ( path . normalize ( file . path ) , path . normalize ( __dirname + '/templates.js' ) ) ;
157157 assert . equal ( file . relative , 'templates.js' ) ;
158- assert . equal ( file . contents . toString ( 'utf8' ) , 'angular.module(" templates" ).run([" $templateCache" , function($templateCache) {$templateCache.put(" /tpl-a.html"," <h1 id=\\ "template-a\\ ">I\\\'m template A!</h1>" );}]);' ) ;
158+ assert . equal ( file . contents . toString ( 'utf8' ) , 'angular.module(\' templates\' ).run([\' $templateCache\' , function($templateCache) {$templateCache.put(\' /tpl-a.html\',\' <h1 id="template-a">I\\\'m template A!</h1>\' );}]);' ) ;
159159 cb ( ) ;
160160 } ) ;
161161
@@ -171,15 +171,15 @@ describe('gulp-angular-templatecache', function () {
171171 it ( 'should set the final url, after any root option has been applied' , function ( cb ) {
172172 var stream = templateCache ( 'templates.js' , {
173173 root : './views' ,
174- transformUrl : function ( url ) {
174+ transformUrl : function ( url ) {
175175 return '/completely/transformed/final' ;
176176 }
177177 } ) ;
178178
179179 stream . on ( 'data' , function ( file ) {
180180 assert . equal ( path . normalize ( file . path ) , path . normalize ( __dirname + '/templates.js' ) ) ;
181181 assert . equal ( file . relative , 'templates.js' ) ;
182- assert . equal ( file . contents . toString ( 'utf8' ) , 'angular.module(" templates" ).run([" $templateCache" , function($templateCache) {$templateCache.put(" /completely/transformed/final"," <h1 id=\\ "template-a\\ ">I\\\'m template A!</h1>" );}]);' ) ;
182+ assert . equal ( file . contents . toString ( 'utf8' ) , 'angular.module(\' templates\' ).run([\' $templateCache\' , function($templateCache) {$templateCache.put(\' /completely/transformed/final\',\' <h1 id="template-a">I\\\'m template A!</h1>\' );}]);' ) ;
183183 cb ( ) ;
184184 } ) ;
185185
@@ -205,7 +205,7 @@ describe('gulp-angular-templatecache', function () {
205205 stream . on ( 'data' , function ( file ) {
206206 assert . equal ( path . normalize ( file . path ) , path . normalize ( __dirname + '/templates.js' ) ) ;
207207 assert . equal ( file . relative , 'templates.js' ) ;
208- assert . equal ( file . contents . toString ( 'utf8' ) , 'angular.module(" templates" , []).run([" $templateCache" , function($templateCache) {$templateCache.put(" /template-a.html"," <h1 id=\\ "template-a\\ ">I\\\'m template A!</h1>" );}]);' ) ;
208+ assert . equal ( file . contents . toString ( 'utf8' ) , 'angular.module(\' templates\' , []).run([\' $templateCache\' , function($templateCache) {$templateCache.put(\' /template-a.html\',\' <h1 id="template-a">I\\\'m template A!</h1>\' );}]);' ) ;
209209 cb ( ) ;
210210 } ) ;
211211
@@ -251,7 +251,7 @@ describe('gulp-angular-templatecache', function () {
251251 stream . on ( 'data' , function ( file ) {
252252 assert . equal ( path . normalize ( file . path ) , path . normalize ( __dirname + '/foobar.js' ) ) ;
253253 assert . equal ( file . relative , 'foobar.js' ) ;
254- assert . equal ( file . contents . toString ( 'utf8' ) , 'angular.module(" templates" , []).run([" $templateCache" , function($templateCache) {$templateCache.put(" /views/template-a.html"," <h1 id=\\ "template-a\\ ">I\\\'m template A!</h1>" );}]);' ) ;
254+ assert . equal ( file . contents . toString ( 'utf8' ) , 'angular.module(\' templates\' , []).run([\' $templateCache\' , function($templateCache) {$templateCache.put(\' /views/template-a.html\',\' <h1 id="template-a">I\\\'m template A!</h1>\' );}]);' ) ;
255255 cb ( ) ;
256256 } ) ;
257257
@@ -279,7 +279,7 @@ describe('gulp-angular-templatecache', function () {
279279 stream . on ( 'data' , function ( file ) {
280280 assert . equal ( path . normalize ( file . path ) , path . normalize ( __dirname + '/templates.js' ) ) ;
281281 assert . equal ( file . relative , 'templates.js' ) ;
282- assert . equal ( file . contents . toString ( 'utf8' ) , 'angular.module(" templates" , []).run([" $templateCache" , function($templateCache) {$templateCache.put(" /views/test/template-a.html"," <h1 id=\\ "template-a\\ ">I\\\'m template A!</h1>" );}]);' ) ;
282+ assert . equal ( file . contents . toString ( 'utf8' ) , 'angular.module(\' templates\' , []).run([\' $templateCache\' , function($templateCache) {$templateCache.put(\' /views/test/template-a.html\',\' <h1 id="template-a">I\\\'m template A!</h1>\' );}]);' ) ;
283283 cb ( ) ;
284284 } ) ;
285285
@@ -304,7 +304,7 @@ describe('gulp-angular-templatecache', function () {
304304 stream . on ( 'data' , function ( file ) {
305305 assert . equal ( path . normalize ( file . path ) , path . normalize ( __dirname + '/templates.js' ) ) ;
306306 assert . equal ( file . relative , 'templates.js' ) ;
307- assert . equal ( file . contents . toString ( 'utf8' ) , 'angular.module(" templates" , []).run([" $templateCache" , function($templateCache) {$templateCache.put(" /templates/all/template-a.html"," <h1 id=\\ "template-a\\ ">I\\\'m template A!</h1>" );}]);' ) ;
307+ assert . equal ( file . contents . toString ( 'utf8' ) , 'angular.module(\' templates\' , []).run([\' $templateCache\' , function($templateCache) {$templateCache.put(\' /templates/all/template-a.html\',\' <h1 id="template-a">I\\\'m template A!</h1>\' );}]);' ) ;
308308 cb ( ) ;
309309 } ) ;
310310
@@ -331,7 +331,7 @@ describe('gulp-angular-templatecache', function () {
331331 stream . on ( 'data' , function ( file ) {
332332 assert . equal ( file . path , path . normalize ( __dirname + '/templates.js' ) ) ;
333333 assert . equal ( file . relative , 'templates.js' ) ;
334- assert . equal ( file . contents . toString ( 'utf8' ) , '\'use strict\'; module.exports = angular.module(" templates" , []).run([" $templateCache" , function($templateCache) {$templateCache.put(" /template-a.html"," <h1 id=\\ "template-a\\ ">I\\\'m template A!</h1>" );}]);' ) ;
334+ assert . equal ( file . contents . toString ( 'utf8' ) , '\'use strict\'; module.exports = angular.module(\' templates\' , []).run([\' $templateCache\' , function($templateCache) {$templateCache.put(\' /template-a.html\',\' <h1 id="template-a">I\\\'m template A!</h1>\' );}]);' ) ;
335335 cb ( ) ;
336336 } ) ;
337337
@@ -352,7 +352,7 @@ describe('gulp-angular-templatecache', function () {
352352 stream . on ( 'data' , function ( file ) {
353353 assert . equal ( path . normalize ( file . path ) , path . normalize ( __dirname + '/templates.js' ) ) ;
354354 assert . equal ( file . relative , 'templates.js' ) ;
355- assert . equal ( file . contents . toString ( 'utf8' ) , 'define([\'angular\'], function(angular) { \'use strict\'; return angular.module(" templates" ).run([" $templateCache" , function($templateCache) {$templateCache.put(" /template-a.html"," <h1 id=\\ "template-a\\ ">I\\\'m template A!</h1>" );}]);});' ) ;
355+ assert . equal ( file . contents . toString ( 'utf8' ) , 'define([\'angular\'], function(angular) { \'use strict\'; return angular.module(\' templates\' ).run([\' $templateCache\' , function($templateCache) {$templateCache.put(\' /template-a.html\',\' <h1 id="template-a">I\\\'m template A!</h1>\' );}]);});' ) ;
356356 cb ( ) ;
357357 } ) ;
358358
@@ -373,7 +373,7 @@ describe('gulp-angular-templatecache', function () {
373373 stream . on ( 'data' , function ( file ) {
374374 assert . equal ( path . normalize ( file . path ) , path . normalize ( __dirname + '/templates.js' ) ) ;
375375 assert . equal ( file . relative , 'templates.js' ) ;
376- assert . equal ( file . contents . toString ( 'utf8' ) , 'import angular from \'angular\'; export default angular.module(" templates" ).run([" $templateCache" , function($templateCache) {$templateCache.put(" /template-a.html"," <h1 id=\\ "template-a\\ ">I\\\'m template A!</h1>" );}]);' ) ;
376+ assert . equal ( file . contents . toString ( 'utf8' ) , 'import angular from \'angular\'; export default angular.module(\' templates\' ).run([\' $templateCache\' , function($templateCache) {$templateCache.put(\' /template-a.html\',\' <h1 id="template-a">I\\\'m template A!</h1>\' );}]);' ) ;
377377 cb ( ) ;
378378 } ) ;
379379
@@ -399,7 +399,7 @@ describe('gulp-angular-templatecache', function () {
399399 stream . on ( 'data' , function ( file ) {
400400 assert . equal ( file . path , path . normalize ( __dirname + '/templates.js' ) ) ;
401401 assert . equal ( file . relative , 'templates.js' ) ;
402- assert . equal ( file . contents . toString ( 'utf8' ) , 'var template = "$templateCache.put(" /template-a.html"," yoo" );";' ) ;
402+ assert . equal ( file . contents . toString ( 'utf8' ) , 'var template = "$templateCache.put(\' /template-a.html\',\' yoo\' );";' ) ;
403403 cb ( ) ;
404404 } ) ;
405405
@@ -424,7 +424,7 @@ describe('gulp-angular-templatecache', function () {
424424 stream . on ( 'data' , function ( file ) {
425425 assert . equal ( file . path , path . normalize ( __dirname + '/templates.js' ) ) ;
426426 assert . equal ( file . relative , 'templates.js' ) ;
427- assert . equal ( file . contents . toString ( 'utf8' ) , 'angular.module(" templates" ).run([" $templateCache" , function($templateCache) {$templateCache.put(\'/template-a.html\',\'yoo\');}]);' ) ;
427+ assert . equal ( file . contents . toString ( 'utf8' ) , 'angular.module(\' templates\' ).run([\' $templateCache\' , function($templateCache) {$templateCache.put(\'/template-a.html\',\'yoo\');}]);' ) ;
428428 cb ( ) ;
429429 } ) ;
430430
0 commit comments