Преглед на файлове

Node 0.x compatibility

pull/713/head
Enno Woortmann GitHub преди 6 години
родител
ревизия
647d842f82
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
променени са 1 файла, в които са добавени 16 реда и са изтрити 4 реда
  1. +16
    -4
      test/partial-test.js

+ 16
- 4
test/partial-test.js Целия файл

@@ -110,18 +110,30 @@ describe('Partials spec', function () {
assert.equal(renderResult, expected);
});

it('Partial should inherit functions without indentation.', function () {
it('Partial without indentation should inherit functions.', function () {
var template = '{{> partial }}';
var data = {t: () => (label) => label.toUpperCase()};
var data = {
t: function () {
return function (label) {
return label.toUpperCase();
};
}
};
var partials = {partial: '{{ #t }}Input{{ /t }}:'};
var expected = 'INPUT:';
var renderResult = Mustache.render(template, data, partials);
assert.equal(renderResult, expected);
});

it('Partial should inherit functions with indentation.', function () {
it('Partial with indentation should inherit functions.', function () {
var template = ' {{> partial }}';
var data = {t: () => (label) => label.toUpperCase()};
var data = {
t: function () {
return function (label) {
return label.toUpperCase();
};
}
};
var partials = {partial: '{{ #t }}Input{{ /t }}:'};
var expected = ' INPUT:';
var renderResult = Mustache.render(template, data, partials);


Loading…
Отказ
Запис