From 5f6e6ef08bfb279134fe79fa17343ee77573dffa Mon Sep 17 00:00:00 2001 From: ExE Boss <3889017+ExE-Boss@users.noreply.github.com> Date: Tue, 10 Sep 2019 02:10:00 +0200 Subject: [PATCH] =?UTF-8?q?test:=20Assert=C2=A0that=C2=A0disabling=20legac?= =?UTF-8?q?y=C2=A0includes=20works=C2=A0correctly?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/ejs.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/ejs.js b/test/ejs.js index 5877264e..57a51066 100755 --- a/test/ejs.js +++ b/test/ejs.js @@ -1167,6 +1167,16 @@ suite('preprocessor include', function () { throw new Error('expected inclusion error'); }); + test('legacy includes are a syntax error when disabled', function() { + try { + ejs.render('<%- include is-syntax-error %>', null, {legacyInclude: false}); + } + catch (err) { + assert.ok(err.message.indexOf('missing ) after argument list') > -1); + return; + } + throw new Error('expected SyntaxError from legacy include being disabled'); + }); }); suite('comments', function () {