Skip to content

fix: run test chains that never executed and await runUpdate in update - #731

Merged
arjankowski merged 2 commits into
mainfrom
fix-tests-that-never-run
Oct 27, 2026
Merged

arjankowski merged 2 commits into
mainfrom
fix-tests-that-never-run

Conversation

@arjankowski

@arjankowski arjankowski commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

42 @oclif/test chains were nested inside mocha it blocks (via await or return) or had no .it(), so they were never scheduled and passed regardless of the code. Move them directly under describe, configure stubs in .do(), and fix assertions that surfaced once they ran:

  • read stderr instead of stdout for messages printed with this.info and errors handled by BoxCommand.catch
  • use a port supported by the Official Box CLI app in the login fallback test
  • accept unset autoUpdate/force flags as falsy in update tests
  • drop update channel tests; channel support was removed from the command

The re-enabled update tests exposed two bugs in the update command:

  • runUpdate was not awaited, so a failed update surfaced as an unhandled promise rejection instead of going through oclif's error handling
  • box update crashed on Node 18 with SyntaxError: Invalid regular expression flags: @oclif/table >= 0.5.5 depends on string-width@8, which requires Node 20. Pin @oclif/table to 0.5.4 and import it only for --available.

@arjankowski
arjankowski requested a review from a team October 23, 2026 10:57
@arjankowski
arjankowski force-pushed the fix-tests-that-never-run branch from f2ab91c to d9e7cfc Compare October 23, 2026 11:19
@socket-security

socket-security Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatednpm/​@​oclif/​table@​0.5.9 ⏵ 0.5.499 +110010090100

View full report

@coveralls

coveralls commented Oct 23, 2026 •

Copy link
Copy Markdown

Coverage Report for CI Build 39964600876

Coverage increased (+2.1%) to 87.047%

Details

  • Coverage increased (+2.1%) from the base build.
  • Patch coverage: 3 of 3 lines across 1 file are fully covered (100%).
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 6061
Covered Lines: 5499
Line Coverage: 90.73%
Relevant Branches: 2153
Covered Branches: 1651
Branch Coverage: 76.68%
Branches in Coverage %: Yes
Coverage Strength: 645.6 hits per line

💛 - Coveralls

Comment thread src/commands/update.js Outdated
Comment thread test/commands/login.test.js Outdated
Comment thread package.json
42 `@oclif/test` chains were nested inside mocha `it` blocks (via `await`
or `return`) or had no `.it()`, so they were never scheduled and passed
regardless of the code. Move them directly under `describe`, configure
stubs in `.do()`, and fix assertions that surfaced once they ran:

- read `stderr` instead of `stdout` for messages printed with `this.info`
  and errors handled by `BoxCommand.catch`
- use a port supported by the Official Box CLI app in the login fallback test
- accept unset `autoUpdate`/`force` flags as falsy in update tests
- drop update channel tests; channel support was removed from the command

The re-enabled update tests exposed two bugs in the `update` command:

- `runUpdate` was not awaited, so a failed update surfaced as an unhandled
  promise rejection instead of going through oclif's error handling
- `box update` crashed on Node 18 with `SyntaxError: Invalid regular
  expression flags`: `@oclif/table` >= 0.5.5 depends on `string-width@8`,
  which requires Node 20. Pin `@oclif/table` to 0.5.4 and import it only
  for `--available`.
…n test

- parse `GithubUpdatecommand` instead of the plugin's `UpdateCommand`, so
  `box update stable` fails with "Unexpected argument" instead of silently
  ignoring the channel
- bind the first free port from `SUPPORTED_DEFAULT_APP_PORTS` in the
  `--code` login test instead of hardcoding 4000
- document why `@oclif/table` is pinned to 0.5.4
@arjankowski
arjankowski force-pushed the fix-tests-that-never-run branch from aaec1b7 to f2c1a23 Compare October 23, 2026 13:50
@antusus antusus changed the title fix: run test chains that never executed and await runUpdate in udate fix: run test chains that never executed and await runUpdate in update Oct 27, 2026

@antusus antusus left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@arjankowski
arjankowski merged commit 8e1cecf into main Oct 27, 2026
21 checks passed
@arjankowski
arjankowski deleted the fix-tests-that-never-run branch October 27, 2026 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants