Skip to content

Commit a6aa976

Browse files
committed
Added test for moduleSystem option value 'IIFE'
1 parent 2f4cb33 commit a6aa976

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

test/test.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,27 @@ describe('gulp-angular-templatecache', function () {
386386
stream.end();
387387
});
388388

389+
it('should support IIFE-style exports', function (cb) {
390+
var stream = templateCache('templates.js', {
391+
moduleSystem: 'IIFE'
392+
});
393+
394+
stream.on('data', function (file) {
395+
assert.equal(path.normalize(file.path), path.normalize(__dirname + '/templates.js'));
396+
assert.equal(file.relative, 'templates.js');
397+
assert.equal(file.contents.toString('utf8'), '(function(){\'use strict\';angular.module(\'templates\').run([\'$templateCache\', function($templateCache) {$templateCache.put(\'/template-a.html\',\'<h1 id="template-a">I\\\'m template A!</h1>\');}]);})();');
398+
cb();
399+
});
400+
401+
stream.write(new Vinyl({
402+
base: __dirname,
403+
path: __dirname + '/template-a.html',
404+
contents: new Buffer('<h1 id="template-a">I\'m template A!</h1>')
405+
}));
406+
407+
stream.end();
408+
});
409+
389410
});
390411

391412
describe('options.templateHeader & options.templateFooter', function () {

0 commit comments

Comments
 (0)