Skip to content

Commit

Permalink
Replaced t.indexOf() by t.match() (#357)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelfranca committed Jun 22, 2022
1 parent 2928d13 commit 3bc3a05
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions test/cli-rc.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,8 @@ test('cli', (t) => {
data += chunk
})
child.on('close', function () {
t.equal(
data.toString().indexOf('Error: Failed to load runtime configuration file: pino-pretty.config.missing.json') >= 0,
true
)
t.match(
data.toString(), 'Error: Failed to load runtime configuration file: pino-pretty.config.missing.json')
})
t.teardown(() => child.kill())
})
Expand All @@ -214,7 +212,7 @@ test('cli', (t) => {
data += chunk
})
child.on('close', function () {
t.equal(data.indexOf('Error: Invalid runtime configuration file: pino-pretty.config.js') >= 0, true)
t.match(data, 'Error: Invalid runtime configuration file: pino-pretty.config.js')
})
t.teardown(() => child.kill())
})
Expand All @@ -234,7 +232,7 @@ test('cli', (t) => {
data += chunk
})
child.on('close', function () {
t.equal(data.indexOf('Error: Invalid runtime configuration file: pino-pretty.config.invalid.js') >= 0, true)
t.match(data, 'Error: Invalid runtime configuration file: pino-pretty.config.invalid.js')
})
t.teardown(() => child.kill())
})
Expand Down

0 comments on commit 3bc3a05

Please sign in to comment.