Skip to content

Add async expectation helper functions for store state validation#87

Merged
DevYeom merged 2 commits into
mainfrom
test-helper
Sep 21, 2024
Merged

Add async expectation helper functions for store state validation#87
DevYeom merged 2 commits into
mainfrom
test-helper

Conversation

@DevYeom
Copy link
Copy Markdown
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
@DevYeom DevYeom deleted the test-helper branch September 21, 2024 03:08
@DevYeom
Copy link
Copy Markdown
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