Skip to content

Commit

Permalink
Merge pull request #459 from EB-Forks/test/disable-legacy-include-dir…
Browse files Browse the repository at this point in the history
…ective

test: Assert that disabling legacy includes works correctly
  • Loading branch information
mde authored Sep 10, 2019
2 parents b364cc3 + 5f6e6ef commit 3dc11e9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/ejs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down

0 comments on commit 3dc11e9

Please sign in to comment.