Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added tests for falsey attr values. Closes #120

nevermind :) this works as I would expect, people dont need to || ""
  • Loading branch information...
commit 5b249e849d6ace2978ab3f1aebb99743f670a9e1 1 parent 372de2a
TJ Holowaychuk tj authored
Showing with 4 additions and 0 deletions.
  1. +4 −0 test/jade.test.js
4 test/jade.test.js
View
@@ -491,6 +491,10 @@ module.exports = {
},
'test code attrs': function(assert){
+ assert.equal('<p></p>', render('p(id: name)', { locals: { name: undefined }}));
+ assert.equal('<p></p>', render('p(id: name)', { locals: { name: null }}));
+ assert.equal('<p></p>', render('p(id: name)', { locals: { name: false }}));
+ assert.equal('<p></p>', render('p(id: name)', { locals: { name: '' }}));
assert.equal('<p id="tj"></p>', render('p(id: name)', { locals: { name: 'tj' }}));
assert.equal('<p id="default"></p>', render('p(id: name || "default")', { locals: { name: null }}));
assert.equal('<p id="something"></p>', render("p(id: 'something')", { locals: { name: null }}));
Please sign in to comment.
Something went wrong with that request. Please try again.