Skip to content
This repository has been archived by the owner on Jun 26, 2023. It is now read-only.

fix: update dialer tests #116

Merged
merged 5 commits into from
Dec 15, 2021
Merged

fix: update dialer tests #116

merged 5 commits into from
Dec 15, 2021

Conversation

achingbrain
Copy link
Member

@achingbrain achingbrain commented Dec 10, 2021

The mockUpgrader is supposed to accept a MultiaddrConnection and return a Connection, but it just passes through the MultiaddrConnection.

This is a problem as the two types are not compatible. This shows up in our code as our tests treat Connections as if they are something you can pass to it-pipe but they are not, you have to get a MuxedStream from conn.netStream([str]) for that.

This PR fixes up the mockUpgrader to return something compatible with the Connection interface. It also removes a few of the dialer tests that were only testing the newly introduced mock code.

The `mockUpgrader` is supposed to accept a `MultiaddrConnection` and
return a `Connection`, but it just passes through the `MultiaddrConnection`.

This is a problem as the two types are not compatible.  This shows up in our
code as our tests treat `Connection`s as if they are something you can pass
to `it-pipe` but they are not.

This PR fixes up the `mockUpgrader` to return something compatible with the
`Connection` interface.  It also removes a few of the dialer tests that were
only testing the newly introduced mock code.
achingbrain added a commit to libp2p/js-libp2p-tcp that referenced this pull request Dec 10, 2021
Converts this module to typescript

Depends on:

- [ ] libp2p/js-libp2p-interfaces#116

BREAKING CHANGE: this module now uses the updated libp2p-interfaces module
@achingbrain achingbrain merged commit c679729 into master Dec 15, 2021
@achingbrain achingbrain deleted the fix/update-dialer-tests branch December 15, 2021 07:13
@github-actions
Copy link

github-actions bot commented Jan 5, 2022

🎉 This PR is included in version @libp2p/interfaces-v1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions
Copy link

github-actions bot commented Jan 5, 2022

🎉 This PR is included in version @libp2p/connection-v1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant