Procházet zdrojové kódy

Node 0.x compatibility

pull/713/head
Enno Woortmann GitHub před 6 roky
rodič
revize
647d842f82
V databázi nebyl nalezen žádný známý klíč pro tento podpis ID GPG klíče: 4AEE18F83AFDEB23
1 změnil soubory, kde provedl 16 přidání a 4 odebrání
  1. +16
    -4
      test/partial-test.js

+ 16
- 4
test/partial-test.js Zobrazit soubor

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


Načítá se…
Zrušit
Uložit