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

feat!: support stubbed properties as well as methods #12

Merged
merged 2 commits into from
Nov 1, 2023

Conversation

achingbrain
Copy link
Owner

Changes the method map passed to stubInterface and friends to be a Partial of the stubbed type.

This way we can pass values for properties and Sinon.stubs for methods, which is usually better since we freqently want to stub behaviour as well as return types which we can't do when we're just passing values.

BREAKING CHANGE: method map values must now be wrapped in Sinon.stub().returns()

Changes the method map passed to `stubInterface` and friends to be
a `Partial` of the stubbed type.

This way we can pass values for properties and `Sinon.stub`s for
methods, which is usually better since we freqently want to stub
behaviour as well as return types which we can't do when we're just
passing values.

BREAKING CHANGE: method map values must now be wrapped in `Sinon.stub().returns()`
@achingbrain achingbrain force-pushed the feat/support-properties-as-well-as-methods branch from f39f2fb to e2bae34 Compare November 1, 2023 16:32
@achingbrain achingbrain merged commit 42413b2 into master Nov 1, 2023
19 checks passed
@achingbrain achingbrain deleted the feat/support-properties-as-well-as-methods branch November 1, 2023 16:38
github-actions bot pushed a commit that referenced this pull request Nov 1, 2023
## [2.0.0](v1.0.2...v2.0.0) (2023-11-01)

### ⚠ BREAKING CHANGES

* method map values must now be wrapped in `Sinon.stub().returns()`

### Features

* support stubbed properties as well as methods ([#12](#12)) ([42413b2](42413b2))
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.

1 participant