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

Add async expectation helper functions for store state validation #87

Merged
merged 2 commits into from
Sep 21, 2024

Conversation

DevYeom
Copy link
Owner

@DevYeom DevYeom commented Sep 21, 2024

Related Issues 💭

Description 📝

  • Added two functions to easily validate the state of the store when writing tests.
    • expect(::timeout:sourceLocation:)
    • xctExpect(::timeout:file:line:)
  • Updated the documentation related to this.

Additional Notes 📚

  • When using Testing
@Test
func incrementTwice() async {
    await sut.send(.increment)
    await sut.send(.increment)

    await sut.expect(\.count, 2)
}
  • When using XCTest
func test_incrementTwice() async {
    await sut.send(.increment)
    await sut.send(.increment)

    await sut.xctExpect(\.count, 2)
}

Checklist ✅

  • If it's a new feature, have appropriate unit tests been added?
  • If the changes affect existing functionality, please verify whether the above information has been appropriately described.

@DevYeom DevYeom self-assigned this Sep 21, 2024
@DevYeom DevYeom changed the title Test helper Add async expectation helper functions for store state validation Sep 21, 2024
@DevYeom DevYeom force-pushed the test-helper branch 6 times, most recently from 7b5e841 to 424aded Compare September 21, 2024 02:59
@DevYeom DevYeom merged commit 87a2b47 into main Sep 21, 2024
2 checks passed
@DevYeom DevYeom deleted the test-helper branch September 21, 2024 03:08
@DevYeom
Copy link
Owner Author

DevYeom commented Sep 23, 2024

All have been deprecated and remade in #97.

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