From a7d4d3bcf5f283c267740d7653b15f9211d228a4 Mon Sep 17 00:00:00 2001 From: Tj Holowaychuk Date: Mon, 2 Aug 2010 08:20:55 -0700 Subject: [PATCH] Added interpolation exception test --- test/jade.test.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/test/jade.test.js b/test/jade.test.js index 3c832aafb..e9fc2ca56 100644 --- a/test/jade.test.js +++ b/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('', render('!!! 5\ninput(type="checkbox", checked)')); assert.equal('', render('!!! 5\ninput(type="checkbox", checked: true)'));