diff options
Diffstat (limited to 'spec/source-map.js')
-rw-r--r-- | spec/source-map.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/source-map.js b/spec/source-map.js new file mode 100644 index 0000000..9b9fa51 --- /dev/null +++ b/spec/source-map.js @@ -0,0 +1,18 @@ +var sourceMap = require('source-map'), + SourceMapConsumer = sourceMap.SourceMapConsumer; + +describe('source-map', function() { + if (!Handlebars.Parser) { + return; + } + + it('returns source map', function() { + var template = Handlebars.precompile('{{foo}}', {filename: 'foo.handlebars', sourcemap: true}); + (typeof template.template).should.equal('string'); + (typeof template.sourcemap).should.equal('string'); + return; + var consumer = new SourceMapConsumer(template.sourcemap); + consumer.eachMapping(function(mapping) { + }, this, SourceMapConsumer.ORIGINAL_ORDER); + }); +}); |