# Code coverage report for spec/require.js

## Statements: 28.57% (4 / 14) Branches: 75% (3 / 4) Functions: 33.33% (1 / 3) Lines: 28.57% (4 / 14) Ignored: none

All files » spec/ » require.js

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    243
    3
    3

    3

     Eif (typeof(require) !== 'undefined' && require.extensions[".handlebars"]) {
      describe('Require', function() {
        it('Load .handlebars files with require()', function() {
          var template = require("./artifacts/example_1");
          equal(template, require("./artifacts/example_1.handlebars"));

          var expected = 'foo\n';
          var result = template({foo: "foo"});

          equal(result, expected);
        });

        it('Load .hbs files with require()', function() {
          var template = require("./artifacts/example_2");
          equal(template, require("./artifacts/example_2.hbs"));

          var expected = 'Hello, World!\n';
          var result = template({name: "World"});

          equal(result, expected);
        });
      });
    }