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

chore: reset info.serialNumber when resetting mock ports #1899

Merged

Conversation

boneskull
Copy link
Contributor

BREAKING CHANGE

Resetting the value in the phony port's info.serialNumber property
when BindingMock.reset() is called will make its behavior "more
deterministic." This is useful when doing deep-equality checks against a
BindingMock instance (or more specifically, a SerialPort instance
containing a BindingMock instance); judicious use of
BindingMock.reset() will mean a developer can expect the value of
info.serialNumber to be deterministic when tests are run in any order
or in isolation.

People have a tendency to code their way around stuff like this, so this
is potentially a breaking change for somebody somewhere.

BREAKING CHANGE

Resetting the value in the phony port's `info.serialNumber` property
when `BindingMock.reset()` is called will make its behavior "more
deterministic." This is useful when doing deep-equality checks against a
`BindingMock` instance (or more specifically, a `SerialPort` instance
containing a `BindingMock` instance); judicious use of
`BindingMock.reset()` will mean a developer can expect the value of
`info.serialNumber` to be deterministic when tests are run in any order
or in isolation.

People have a tendency to code their way around stuff like this, so this
is _potentially_ a breaking change for _somebody somewhere._
@boneskull
Copy link
Contributor Author

If you hate this, you can still keep the test coverage. 😉

Copy link
Member

@reconbot reconbot left a comment

Choose a reason for hiding this comment

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

It’s the perfect time for breaking changes

@reconbot
Copy link
Member

I'm ok with these tests but it should be noted the bindings tests cover the mock bindings as well.

@reconbot reconbot merged commit 6acaac1 into serialport:master Jul 13, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jan 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants