Skip to content

Conversation

@boneskull
Copy link
Owner

Summary

  • Add comprehensive property-based tests for all 14 @bupkis/supertest assertions
  • Export individual assertions from assertions.ts for test access (matching @bupkis/sinon pattern)
  • Create helper arbitraries for HTTP response generation (status codes, headers, URLs, bodies)

Test Coverage

Category Assertions Property Tests
Status Code 2 toHaveStatusAssertion, toHaveStatusCategoryAssertion
Header 3 toHaveHeaderAssertion, toHaveHeaderValueAssertion, toHaveHeaderMatchingAssertion
Body 6 toHaveBodyAssertion, toHaveBodyStringAssertion, toHaveJsonBodyAssertion, toHaveJsonBodySatisfyingAssertion, toHaveBodySatisfyingRegexAssertion, toHaveBodySatisfyingObjectAssertion
Redirect 3 toRedirectAssertion, toRedirectToUrlAssertion, toRedirectToPatternAssertion

Test Plan

  • All 123 tests pass (56 property tests + 67 existing unit tests)
  • ESLint passes
  • Pattern follows existing @bupkis/sinon property tests

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.5 noreply@anthropic.com

Copilot AI review requested due to automatic review settings January 16, 2026 04:55
Copy link
Contributor

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 adds comprehensive property-based tests for all 14 HTTP response assertions in @bupkis/supertest, following the established pattern from @bupkis/sinon. The implementation uses fast-check to generate randomized test inputs and validate assertion behavior across the input space.

Changes:

  • Added property.test.ts with 56 property-based tests covering status code, header, body, and redirect assertions
  • Exported individual assertion functions from assertions.ts for test access (previously only exported the array)
  • Removed unnecessary express/supertest dependencies that were mistakenly added in a previous commit

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.

File Description
packages/supertest/test/property.test.ts New comprehensive property-based test suite with helper arbitraries for HTTP response generation and test configurations for all 14 assertions
packages/supertest/src/assertions.ts Exported individual assertion functions to enable test access while maintaining backward compatibility
packages/supertest/package.json Added fast-check as devDependency, removed unnecessary express/supertest dependencies
package-lock.json Cleaned up dependency tree by removing express, supertest, and their transitive dependencies

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@boneskull boneskull force-pushed the supertest-prop-tests branch from 6b54412 to fb32dc4 Compare January 16, 2026 05:14
Copy link
Owner Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@boneskull boneskull added the chore tooling & overhead label Jan 16, 2026
@boneskull boneskull changed the title feat(supertest): add property-based tests for HTTP response assertions chore(supertest): add property-based tests for HTTP response assertions Jan 16, 2026
boneskull and others added 2 commits January 15, 2026 21:53
This adds comprehensive property tests for all 14 @bupkis/supertest assertions
using @bupkis/property-testing and fast-check. The tests generate random HTTP
responses and validate assertion behavior across the input space.

Changes:
- Export individual assertions for testing access
- Add property test configs for status code assertions (2)
- Add property test configs for header assertions (3)
- Add property test configs for body assertions (6)
- Add property test configs for redirect assertions (3)
- Create helper arbitraries for HTTP response generation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings January 16, 2026 05:53
@boneskull boneskull force-pushed the supertest-prop-tests branch from fb32dc4 to a4a3953 Compare January 16, 2026 05:53
Copy link
Contributor

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

Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@boneskull boneskull merged commit 2fdb928 into main Jan 16, 2026
18 checks passed
@boneskull boneskull deleted the supertest-prop-tests branch January 16, 2026 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore tooling & overhead

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants