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

Refactor Websocket tests #357

Closed
gavv opened this issue Mar 29, 2023 · 2 comments · Fixed by #365
Closed

Refactor Websocket tests #357

gavv opened this issue Mar 29, 2023 · 2 comments · Fixed by #365
Assignees
Labels
good first issue Good for newcomers help wanted Contributions are welcome refactoring Refactoring task tests Improvements or additions to tests
Milestone

Comments

@gavv
Copy link
Owner

gavv commented Mar 29, 2023

After introducing new chain.assert() method, we can simplify many websocket tests.

In websocket_test.go, find all table-driven tests that have assertOk field and refactor them as follows:

  • replace assertOk bool with result chainResult

  • instead of assertOk: true, use result: success

  • instead of assertOk: false, use result: failure

  • instead of:

    if tc.assertOk {
    	ws.chain.assert(t, success)
    } else {
    	ws.chain.assert(t, failure)
    }

    use:

    ws.chain.assert(t, tc.result)
@gavv gavv added tests Improvements or additions to tests help wanted Contributions are welcome refactoring Refactoring task good first issue Good for newcomers labels Mar 29, 2023
@antara-gandhi
Copy link
Contributor

@gavv i'd like to claim this issue!

@gavv
Copy link
Owner Author

gavv commented Mar 29, 2023

@antara-gandhi welcome :)

@gavv gavv closed this as completed in #365 Apr 1, 2023
gavv pushed a commit that referenced this issue Apr 1, 2023
@gavv gavv added this to the v2 milestone Apr 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Contributions are welcome refactoring Refactoring task tests Improvements or additions to tests
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants