summaryrefslogtreecommitdiffstats
path: root/spec/source-map.js
blob: 9b9fa516fb195009f43cb8badb4b1c56955299f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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);
  });
});