Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added interpolation exception test

  • Loading branch information...
commit a7d4d3bcf5f283c267740d7653b15f9211d228a4 1 parent 0928f03
@tj tj authored
Showing with 13 additions and 1 deletion.
  1. +13 −1 test/jade.test.js
View
14 test/jade.test.js
@@ -281,7 +281,7 @@ module.exports = {
err.message);
},
- 'test exceptions': function(assert){
+ 'test code exceptions': function(assert){
var err;
try {
render('p= foo', { cache: true, filename: 'foo', locals: { foo: 'bar' }});
@@ -294,6 +294,18 @@ module.exports = {
err.message);
},
+ 'test interpolation exceptions': function(assert){
+ var err;
+ try {
+ render('p #{foo}');
+ } catch (e) {
+ err = e;
+ }
+ assert.equal(
+ "Jade:1\n 1. 'p #{foo}'\n\nfoo is not defined",
+ err.message);
+ },
+
'test html 5 mode': function(assert){
assert.equal('<!DOCTYPE html><input type="checkbox" checked>', render('!!! 5\ninput(type="checkbox", checked)'));
assert.equal('<!DOCTYPE html><input type="checkbox" checked>', render('!!! 5\ninput(type="checkbox", checked: true)'));
Please sign in to comment.
Something went wrong with that request. Please try again.