Skip to content

Conversation

@wtasg
Copy link
Owner

@wtasg wtasg commented Nov 21, 2025

Summary

This PR fixes the test command and adds automated testing on pull requests.

Changes:

  • package.json: Fixed test script by adding escaped quotes around the glob pattern ("node --test \"src/**/*.test.js\""), ensuring proper shell globbing
  • .github/workflows/npm-test-on-pr.yml: Added new GitHub Actions workflow that automatically runs tests on PR events (opened, reopened, synchronize). Uses Node.js 20 with npm caching and runs npm ci followed by npm test
  • docs/: Updated documentation link references to reflect new commit hash

Impact: Enables automated test execution on pull requests to catch issues early.

@wtasg wtasg self-assigned this Nov 21, 2025
@coderabbitai
Copy link

coderabbitai bot commented Nov 21, 2025

Walkthrough

Adds a GitHub Actions workflow for PR testing, updates documentation links to reference a new commit hash, and adjusts string escaping in the npm test script.

Changes

Cohort / File(s) Summary
CI/CD Configuration
\.github/workflows/npm-test-on-pr.yml
New GitHub Actions workflow triggered on PR events (opened, reopened, synchronize). Defines a job that checks out the repo, sets up Node.js v20 with npm caching, installs dependencies via npm ci, and runs tests.
Documentation Links
docs/docs.json, docs/functions/hello.md
Updated GitHub blob URLs to reference a new commit hash for src/hello.ts. Changes are isolated to documentation link references.
Package Configuration
package.json
Added escaped quotes to test script string: "node --test src/**/*.test.js""node --test \"src/**/*.test.js\"".

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Workflow file follows standard GitHub Actions patterns; verify trigger conditions and job steps align with project requirements
  • Documentation link updates are straightforward reference changes; confirm commit hash is correct

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes both main changes: fixing the test command in package.json and adding the GitHub Actions workflow for running tests on pull requests.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between f604706 and 996981b.

📒 Files selected for processing (4)
  • .github/workflows/npm-test-on-pr.yml (1 hunks)
  • docs/docs.json (2 hunks)
  • docs/functions/hello.md (1 hunks)
  • package.json (1 hunks)
🔇 Additional comments (4)
docs/docs.json (1)

20-20: Documentation links reference the same commit hash.

Both url fields (lines 20 and 54) reference the same commit hash. This is consistent with the update in docs/functions/hello.md. Verification of the commit hash will cover both files.

Also applies to: 54-54

package.json (1)

11-11: Test script escaping fix improves glob handling.

The added quotes around src/**/*.test.js ensure the glob pattern is passed as a single argument to node --test, preventing premature shell expansion. This correctly addresses the test command issue.

.github/workflows/npm-test-on-pr.yml (1)

1-30: PR test workflow is well-configured.

The workflow correctly triggers on PR events, sets up Node.js with caching, and runs tests via npm test. The configuration is standard and minimal. The fetch-depth: 0 ensures full repository history is available if needed.

docs/functions/hello.md (1)

11-11: No issues found.

The commit hash is valid and exists in the repository. The documentation link correctly references the hello function definition at line 6 of src/hello.ts. The update is legitimate.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@wtasg wtasg merged commit ffd5004 into main Nov 21, 2025
1 of 2 checks passed
@wtasg wtasg deleted the fix branch November 21, 2025 05:05
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.

1 participant