Skip to content

test: add coverage for utility modules#718

Open
wilsonwangdev wants to merge 2 commits intonodejs:mainfrom
wilsonwangdev:test/utility-coverage
Open

test: add coverage for utility modules#718
wilsonwangdev wants to merge 2 commits intonodejs:mainfrom
wilsonwangdev:test/utility-coverage

Conversation

@wilsonwangdev
Copy link
Copy Markdown
Contributor

Description

Add unit tests for 4 previously untested pure utility modules:

  • src/utils/array.mjsenforceArray() (4 tests)
  • src/utils/file.mjswithExt() (4 tests)
  • src/utils/misc.mjslazy(), isPlainObject(), deepMerge() (7 tests)
  • src/utils/configuration/templates.mjspopulate() (4 tests)

All 19 new tests follow existing conventions (node:assert/strict, describe/it, co-located __tests__/ directories).

Validation

  • All 362 tests pass (including 19 new)
  • Lint and formatting checks pass

Check List

  • I have read the Contributing Guidelines and made commit messages that follow the guideline.
  • I have run node --run test and all tests passed.
  • I have check code formatting with node --run format & node --run lint.
  • I've covered new added functionality with unit tests if necessary.

Add tests for enforceArray, withExt, lazy, isPlainObject,
deepMerge, and populate — all previously untested pure
utility functions.
@wilsonwangdev wilsonwangdev requested a review from a team as a code owner March 26, 2026 14:31
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 26, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
api-docs-tooling Ready Ready Preview Mar 26, 2026 2:53pm

Request Review

Copy link
Copy Markdown
Member

@avivkeller avivkeller left a comment

Choose a reason for hiding this comment

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

Are you an AI agent? While your implementation is fine, I feel like I'm interacting with a robot.

- Simplify enforceArray tests to two cases (array vs non-array)
- Remove redundant multiple-substitutions test for populate
@wilsonwangdev
Copy link
Copy Markdown
Contributor Author

Are you an AI agent? While your implementation is fine, I feel like I'm interacting with a robot.

I use cursor as my editor, it helps me a lot to do such work 😄

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.

3 participants