fix: replace unanchored regex with string assertions in tests#767
fix: replace unanchored regex with string assertions in tests#767
Conversation
Replace `.not.toMatch(/domain\.com\//)` with `.not.toContain('domain.com/')`
in squid-config.test.ts to resolve CodeQL "Missing regular expression anchor"
alerts (#171, #172). The string-based assertion is clearer in intent since
these tests check for literal substrings (trailing slashes in domains).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
🎬 THE END — Smoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨ |
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤 |
|
Chroot tests passed! Smoke Chroot - All security and functionality tests succeeded. |
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 |
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (1 files)
Coverage comparison generated by |
There was a problem hiding this comment.
Pull request overview
This PR updates Squid config unit tests to avoid unanchored regular expressions flagged by CodeQL by switching to literal substring assertions, while preserving the intent of validating that trailing slashes are removed from domains.
Changes:
- Replaced
.not.toMatch(/github\.com\//)with.not.toContain('github.com/')in the trailing-slash removal test. - Replaced
.not.toMatch(/example\.com\//)with.not.toContain('example.com/')in the protocol+trailing-slash removal test.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Build Test: Node.js Results
Overall: PASS ✅ All Node.js projects built and tested successfully.
|
|
Smoke test results for Claude: Last 2 merged PRs:
Test Results:
Status: PASS
|
Build Test: Deno ✅All tests passed successfully!
Overall: PASS
|
|
Smoke Test Results Last 2 Merged PRs:
Test Results:
Status: PASS 🎉 cc: @Mossaka
|
Go Build Test Results
Overall: PASS ✅ All Go projects successfully downloaded dependencies and passed tests.
|
C++ Build Test Results
Overall: PASS ✅ All C++ projects built successfully.
|
Build Test: Bun - Results
Overall: PASS All Bun build tests completed successfully with Bun v1.3.9.
|
.NET Build Test Results
Overall: PASS ✅ All .NET projects successfully restored, built, and ran with expected output.
|
Rust Build Test Results
Overall: PASS ✅ All Rust projects built and tested successfully.
|
Build Test: Java ✅All Java build tests PASSED
Overall: PASS All Maven projects compiled successfully and all tests passed through the firewall proxy.
|
Chroot Version Comparison Test Results
Overall Result: ❌ Tests did not pass - version mismatches detected The chroot mode is successfully detecting and using host binaries, but version differences indicate the host and container environments are not identical. This is expected behavior as the container uses its own runtime versions when chroot is not accessing host binaries.
|
|
Merged PRs: fix: review recommendations for PR #720 | fix: eliminate nested bash layer in chroot command execution for Java/.NET
|
Summary
.not.toMatch(/github\.com\//)and.not.toMatch(/example\.com\//)with.not.toContain('github.com/')and.not.toContain('example.com/')insrc/squid-config.test.tstoContainis semantically clearer since these tests verify that trailing slashes are stripped from domain strings, not that a regex pattern is absentTest plan
npm run buildpassesnpm testpasses (all 19 test suites)🤖 Generated with Claude Code