Skip to content

Conversation

@thehabes
Copy link
Member

@thehabes thehabes commented Oct 2, 2025

Includes updated exists tests.

@thehabes thehabes self-assigned this Oct 3, 2025
@thehabes thehabes changed the title NPM Package Updates TinyNode NPM Package Updates Oct 6, 2025
@thehabes thehabes linked an issue Oct 6, 2025 that may be closed by this pull request
@thehabes thehabes marked this pull request as ready for review October 6, 2025 20:09
@thehabes thehabes requested a review from cubap as a code owner October 6, 2025 20:09
@thehabes thehabes requested a review from Copilot October 6, 2025 20:10
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates NPM package dependencies for the TinyNode project and refactors route existence testing. The primary purpose is to modernize dependencies and improve test organization by moving route detection logic into a reusable function.

  • Updated multiple NPM packages to newer versions including Express, Jest, and other core dependencies
  • Refactored route existence testing by extracting duplicated logic into a reusable routeExists function
  • Moved demo interface tests to a separate test file and added file existence checks

Reviewed Changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.

File Description
package.json Updated NPM dependencies to newer versions and Node.js engine requirement
routes/tests/mount.test.js Refactored route existence tests with reusable function and added file existence checks
routes/tests/index.test.js New test file containing demo interface tests moved from mount.test.js

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

* @returns {boolean} - True if all routes are found
*/
function routeExists(routes) {
const stack = app.router.stack
Copy link

Copilot AI Oct 6, 2025

Choose a reason for hiding this comment

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

The property should be app._router.stack instead of app.router.stack. Express apps use the private _router property to access the router stack.

Suggested change
const stack = app.router.stack
const stack = app._router.stack

Copilot uses AI. Check for mistakes.
Copy link
Member Author

Choose a reason for hiding this comment

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

NOT ANYMORE BECAUSE EXPRESS 5

@thehabes thehabes merged commit 5e54168 into main Oct 15, 2025
3 checks passed
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.

Establish Tests That Check if All Expected Routes are Registered

2 participants