Skip to content

Commit dd835ee

Browse files
author
Jeff Escalante
committed
expression error tests
1 parent da15af7 commit dd835ee

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<if condition='#W$@RWF~'>
2+
<p>hi</p>
3+
</if>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{{ @#!$R }}

test/index.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@ test('expression spacing', (t) => {
2323
return matchExpected(t, 'expression_spacing', { locals: { foo: 'X' } })
2424
})
2525

26-
test.todo('expression error')
26+
test('expression error', (t) => {
27+
return expectError('expression_error', (err) => {
28+
t.truthy(err.toString() === 'SyntaxError: Unexpected token ILLEGAL')
29+
})
30+
})
2731

2832
test('conditional', (t) => {
2933
return matchExpected(t, 'conditional', { locals: { foo: 'bar' } })
@@ -57,7 +61,11 @@ test('conditional - nested conditionals', (t) => {
5761
return matchExpected(t, 'conditional_nested', {})
5862
})
5963

60-
test.todo('conditional - expression error')
64+
test('conditional - expression error', (t) => {
65+
return expectError('conditional_expression_error', (err) => {
66+
t.truthy(err.toString() === 'SyntaxError: Unexpected token ILLEGAL')
67+
})
68+
})
6169

6270
//
6371
// Utility

0 commit comments

Comments
 (0)