Thanks to visit codestin.com
Credit goes to github.com

Skip to content

chore: v7 maintenance#1240

Merged
antongolub merged 5 commits intogoogle:v7from
antongolub:v7
Jun 23, 2025
Merged

chore: v7 maintenance#1240
antongolub merged 5 commits intogoogle:v7from
antongolub:v7

Conversation

@antongolub
Copy link
Collaborator

@antongolub antongolub commented Jun 23, 2025

  • Tests pass
  • Appropriate changes to README are included in PR

@antongolub antongolub requested review from antonmedv and Copilot June 23, 2025 14:50
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 test utilities and refreshes dependencies for v7 maintenance, ensuring more reliable file matching and HTTP server simulation in tests.

  • Added stricter globby options in extra.test.js to limit matches to actual files and avoid symlinks.
  • Introduced an in-process TCP server helper and get-port in cli.test.js for better isolation of HTTP-based tests.
  • Bumped dev/prod dependencies and test scripts in package.json.

Reviewed Changes

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

File Description
test/extra.test.js Added onlyFiles, cwd, and followSymbolicLinks to globby call.
test/cli.test.js Implemented getServer helper with net and get-port; updated tests to use it.
package.json Refactored test script, added test:unit, and bumped various deps.
Comments suppressed due to low confidence (1)

test/cli.test.js:120

  • The out result from $ is usually an object with stdout/stderr; using toString() may not capture just the stdout. Use out.stdout.toString() (or out.toString() if that’s guaranteed) to explicitly match the correct output stream.
  assert.match(out.toString(), /test/)

let out = await $`node build/cli.js http://127.0.0.1:8081`.nothrow()
assert.match(out.stderr, "Error: Can't get")
const port = await getPort()
const server = await getServer(['HTTP/1.1 500\n\n']).listen(port)
Copy link

Copilot AI Jun 23, 2025

Choose a reason for hiding this comment

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

You're calling the built-in listen method instead of the custom start helper, so the promise-based start logic isn't being used. Change .listen(port) to .start(port) to ensure the server is ready before proceeding.

Suggested change
const server = await getServer(['HTTP/1.1 500\n\n']).listen(port)
const server = await getServer(['HTTP/1.1 500\n\n']).start(port)

Copilot uses AI. Check for mistakes.
@antongolub antongolub merged commit 80639c0 into google:v7 Jun 23, 2025
1 check passed
@antongolub antongolub deleted the v7 branch June 23, 2025 15:24
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