Skip to content

Commit

Permalink
chore: fix tests for node v20
Browse files Browse the repository at this point in the history
  • Loading branch information
wraithgar committed May 1, 2023
1 parent 238fc4a commit dc7c5d1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions test/bin/apply.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,21 @@ t.afterEach(() => {

t.test('when npm_config_local_prefix is unset, does nothing', async (t) => {
await templateApply()
t.equal(process.exitCode, undefined, 'exitCode is unset')
t.notOk(process.exitCode, 'exitCode is unset')
})

t.test('when npm_config_global is true, does nothing', async (t) => {
process.env.npm_config_global = 'true'

await templateApply()
t.equal(process.exitCode, undefined, 'exitCode is unset')
t.notOk(process.exitCode, 'exitCode is unset')
})

t.test('with mocks', async (t) => {
process.env.npm_config_local_prefix = 'heynow'

await templateApply(() => {})
t.equal(process.exitCode, undefined, 'exitCode is unset')
t.notOk(process.exitCode, 'exitCode is unset')
})

t.test('error', async (t) => {
Expand All @@ -50,5 +50,5 @@ t.test('error', async (t) => {
await templateApply(() => {
throw new Error('apply')
})
t.equal(process.exitCode, 1, 'exitCode is unset')
t.ok(process.exitCode, 'exitCode is unset')
})
4 changes: 2 additions & 2 deletions test/bin/check.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ t.test('problems', async (t) => {
solution: 'solution2',
}])

This comment has been minimized.

Copy link
@HMMM116

HMMM116 May 4, 2023

اصلاح


t.equal(process.exitCode, 1, 'exit code')
t.ok(process.exitCode, 'exit code')
t.matchSnapshot(errors.join('\n'))
})

Expand All @@ -53,6 +53,6 @@ t.test('no problems', async (t) => {

await templateCheck(() => [])

t.equal(process.exitCode, undefined, 'exit code')
t.notOk(process.exitCode, 'exit code')
t.strictSame(errors, [], 'errors')
})

0 comments on commit dc7c5d1

Please sign in to comment.