This repository has been archived by the owner on May 13, 2023. It is now read-only.
chore: Added 9 tests to socket_test.dart #4
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Tests added: - constructor - sets defaults - overrides some defaults with options - endpointURL - returns endpoint for given full url - returns endpoint with parameters - returns endpoint with apikey - connect with Websocket - establishes websocket connection with endpoint - sets callbacks for connection - is idempotent - disconnect - removes existing connection - calls callback
Main codebase updated.
Tests added: - disconnect - calls connection close callback - does not throw when no connection - channel - returns channel with given topic and params - adds channel to sockets channels list - remove - removes given channel from channels - push - sends data to connection when connected - buffers data when not connected - makeRef - returns next message ref - restarts for overflow
Added tests - sendHeartbeat - pushes heartbeat data when connected - no ops when not connected
EDIT 1: Added 2 more testsAdds test to socket_test.dart Tests added:
|
@hardiksachan nice work!! Thanks you |
You will need to update makeRef(). Something like this
|
can you remove this test from this PR. Then create another PR with main code update for |
Yeah! Sure. |
Hey, can you look at the failed test case. I have no idea why it is failing. |
phamhieu
suggested changes
Nov 17, 2020
phamhieu
approved these changes
Nov 17, 2020
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What kind of change does this PR introduce?
Adds test to socket_test.dart
Tests added:
disconnect
channel
remove
push
makeRef