Skip to content

Commit c5c6079

Browse files
committed
test: use .is instead of .truthy for comparison
shows diffs when a test fails
1 parent 77aaf56 commit c5c6079

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

test/test-conditionals.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function process (t, name, options, log = false) {
2323
return clean(result.html)
2424
})
2525
.then((html) => {
26-
t.truthy(html === expect(name).trim())
26+
t.is(html, expect(name).trim())
2727
})
2828
}
2929

@@ -51,13 +51,13 @@ test('Conditionals - no render', (t) => {
5151

5252
test('Conditionals - "if" tag missing condition', (t) => {
5353
return error('conditional_if_error', (err) => {
54-
t.truthy(err.toString() === 'Error: the "if" tag must have a "condition" attribute')
54+
t.is(err.toString(), 'Error: the "if" tag must have a "condition" attribute')
5555
})
5656
})
5757

5858
test('Conditionals - "elseif" tag missing condition', (t) => {
5959
return error('conditional_elseif_error', (err) => {
60-
t.truthy(err.toString() === 'Error: the "elseif" tag must have a "condition" attribute')
60+
t.is(err.toString(), 'Error: the "elseif" tag must have a "condition" attribute')
6161
})
6262
})
6363

test/test-core.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function process (t, name, options, log = false) {
2323
return clean(result.html)
2424
})
2525
.then((html) => {
26-
t.truthy(html === expect(name).trim())
26+
t.is(html, expect(name).trim())
2727
})
2828
}
2929

test/test-scopes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function process (t, name, options, log = false) {
2323
return clean(result.html)
2424
})
2525
.then((html) => {
26-
t.truthy(html === expect(name).trim())
26+
t.is(html, expect(name).trim())
2727
})
2828
}
2929

test/test-switch.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function process (t, name, options, log = false) {
2323
return clean(result.html)
2424
})
2525
.then((html) => {
26-
t.truthy(html === expect(name).trim())
26+
t.is(html, expect(name).trim())
2727
})
2828
}
2929

@@ -75,7 +75,7 @@ test('Switch - dynamic expression', (t) => {
7575

7676
test('Switch - no switch attribute', (t) => {
7777
return error('switch_no_attr', (err) => {
78-
t.truthy(err.toString() === 'Error: the "switch" tag must have a "expression" attribute')
78+
t.is(err.toString(), 'Error: the "switch" tag must have a "expression" attribute')
7979
})
8080
})
8181

0 commit comments

Comments
 (0)