diff --git a/packages/spacebars-compiler/spacebars_tests.js b/packages/spacebars-compiler/spacebars_tests.js index 530a47bc3..01ea0f725 100644 --- a/packages/spacebars-compiler/spacebars_tests.js +++ b/packages/spacebars-compiler/spacebars_tests.js @@ -246,12 +246,29 @@ Tinytest.add("spacebars-compiler - parse", function (test) { test.equal(BlazeTools.toJS(SpacebarsCompiler.parse('{{#foo}}x{{else bar}}{{#baz}}z{{/baz}}{{/foo}}')), 'SpacebarsCompiler.TemplateTag({type: "BLOCKOPEN", path: ["foo"], content: "x", elseContent: SpacebarsCompiler.TemplateTag({type: "BLOCKOPEN", path: ["bar"], content: SpacebarsCompiler.TemplateTag({type: "BLOCKOPEN", path: ["baz"], content: "z"})})})'); + // Triple-stache in start tag — should mention raw HTML test.throws(function () { SpacebarsCompiler.parse(''); - }); + }, 'not allowed in an HTML start tag'); + + // Block helper in start tag — should suggest attribute="{{helper}}" pattern test.throws(function () { SpacebarsCompiler.parse(''); - }); + }, 'not allowed in an HTML start tag'); + + // Common real-world patterns that trigger this error + test.throws(function () { + SpacebarsCompiler.parse(''); + }, 'Bad syntax'); + test.throws(function () { + SpacebarsCompiler.parse('