Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for dialers in invariant testing #109

Merged
merged 19 commits into from
Feb 5, 2025
Merged

Conversation

BowTiedRadone
Copy link
Collaborator

@BowTiedRadone BowTiedRadone commented Feb 4, 2025

This PR introduces support for custom pre- and post-execution JavaScript functions, called dialers, in invariant testing. Dialers run before and after public function calls, allowing users to add custom assertions, behaviors, or side effects during execution. Thanks to @moodmosaic for designing this feature in #59 (comment). Resolves #59.

app.ts Show resolved Hide resolved
app.ts Outdated Show resolved Hide resolved
invariant.ts Outdated Show resolved Hide resolved
invariant.ts Outdated Show resolved Hide resolved
invariant.ts Outdated Show resolved Hide resolved
dialer.ts Outdated Show resolved Hide resolved
dialer.ts Outdated Show resolved Hide resolved
@BowTiedRadone BowTiedRadone force-pushed the feat/dialers branch 2 times, most recently from 149b329 to c70f272 Compare February 4, 2025 17:53
@BowTiedRadone BowTiedRadone changed the title [DRAFT] Add support for dialers in invariant testing Add support for dialers in invariant testing Feb 4, 2025
@BowTiedRadone BowTiedRadone marked this pull request as ready for review February 4, 2025 22:36
@BowTiedRadone BowTiedRadone requested a review from a team as a code owner February 4, 2025 22:36
@BowTiedRadone
Copy link
Collaborator Author

Before merging this PR, we should update the README to reflect the final dialers feature.

Copy link
Member

@moodmosaic moodmosaic left a comment

Choose a reason for hiding this comment

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

Very nice! Left some comments mostly around using the context type instead of any type.

app.tests.ts Show resolved Hide resolved
dialer.ts Show resolved Hide resolved
example/sip010.js Outdated Show resolved Hide resolved
dialer.types.ts Outdated Show resolved Hide resolved
dialer.types.ts Outdated Show resolved Hide resolved
dialer.tests.ts Outdated Show resolved Hide resolved
dialer.tests.ts Outdated Show resolved Hide resolved
dialer.tests.ts Outdated Show resolved Hide resolved
dialer.tests.ts Outdated Show resolved Hide resolved
dialer.tests.ts Outdated Show resolved Hide resolved
@BowTiedRadone BowTiedRadone force-pushed the feat/dialers branch 3 times, most recently from 071d9ad to a1c2aeb Compare February 5, 2025 14:49
invariant.ts Outdated Show resolved Hide resolved
invariant.ts Outdated Show resolved Hide resolved
Copy link
Member

@moodmosaic moodmosaic left a comment

Choose a reason for hiding this comment

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

LGTM! 🚀

BowTiedRadone and others added 17 commits February 5, 2025 18:53
This commit introduces support for custom pre- and post-execution JavaScript
functions, called "dialers", in invariant testing. Dialers run before and after
public function calls, allowing users to add custom assertions, behaviors, or
side effects during execution. Thanks to @moodmosaic for designing this feature
in #59 (comment).
This commit adds references for the example dialers file and refines it for
correctness, readability, and consistency.
@BowTiedRadone BowTiedRadone merged commit 7c0c90f into master Feb 5, 2025
21 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.

Add printed events to the context for assertions
2 participants