diff --git a/__test__/index.spec.ts b/__test__/index.spec.ts index e3431f6..797713a 100644 --- a/__test__/index.spec.ts +++ b/__test__/index.spec.ts @@ -33,13 +33,13 @@ test('run command', (t) => { test('run help', (t) => { const result = spawnSync('node', [`examples/simple.cjs`, '--help']) t.falsy(result.error) - t.deepEqual(result.status, 0) + t.deepEqual(result.status ?? 0, 0) }) test('run version', (t) => { const version = spawnSync('node', [`examples/simple.cjs`, '--version']) const no_version = spawnSync('node', [`examples/no_version.cjs`, '--version']) t.falsy(version.error) - t.deepEqual(version.status, 0) - t.not(no_version.status, 0) + t.deepEqual(version.status ?? 0, 0) + t.not(no_version.status ?? 0, 0) }) diff --git a/__test__/options.spec.ts b/__test__/options.spec.ts index c767953..c04db72 100644 --- a/__test__/options.spec.ts +++ b/__test__/options.spec.ts @@ -26,8 +26,8 @@ test('required positional option', (t) => { const result = spawnSync('node', [`examples/positional_required.cjs`, 'foo']) const should_fail = spawnSync('node', [`examples/positional_required.cjs`]) t.falsy(result.error) - t.deepEqual(result.status, 0) - t.not(should_fail.status, 0) + t.deepEqual(result.status ?? 0, 0) + t.not(should_fail.status ?? 0, 0) }) test('boolean flag', (t) => {