shunter
Version:
A Node.js application built to read JSON and translate it into HTML
27 lines (22 loc) • 647 B
JavaScript
;
var assert = require('proclaim');
var helper = require('../../helpers/template.js')();
describe('Dust Filter: trim', function() {
it('Should trim leading and trailing whitespace from a string', function(done) {
helper.render('{test|trim}', {
test: ' \t\r\nhello world \n\t\r'
}, function(err, dom, str) {
assert.strictEqual(str, 'hello world');
done();
});
});
it('Should not throw if the input is not a string', function(done) {
helper.render('hello world{test|trim}', {
test: 3
}, function(err, dom, str) {
assert.isNull(err);
assert.strictEqual(str, 'hello world3');
done();
});
});
});