Przeglądaj źródła

Node 0.x compatibility

pull/713/head
Enno Woortmann GitHub 6 lat temu
rodzic
commit
647d842f82
Nie znaleziono w bazie danych klucza dla tego podpisu ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 16 dodań i 4 usunięć
  1. +16
    -4
      test/partial-test.js

+ 16
- 4
test/partial-test.js Wyświetl plik

@@ -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);


Ładowanie…
Anuluj
Zapisz