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

Unit test #3

Open
JohnEtas9 opened this issue Apr 2, 2022 · 2 comments
Open

Unit test #3

JohnEtas9 opened this issue Apr 2, 2022 · 2 comments

Comments

@JohnEtas9
Copy link

Hi nguyen come across with composable architecture,

would you mind provide the sample for unit test as well, it would be more pleasure to have it 😄

Thank you

@NguyenPhongVN
Copy link
Member

Hi JohnEtas9.
I don't have time for this, you can test simple like:

        let store = Store(initialState: CounterState(), reducer: CounterReducer, environment: CounterEnvironment())
        let viewStore = ViewStore(store)
        viewStore.send(.increment)
        viewStore.publisher.sink { value in
            XCTAssertEqual(1, value.count)
        }
        .store(in: &cancellables)

@NguyenPhongVN
Copy link
Member

I welcome any contribution, if you have any idea, suggestion, let me know @JohnEtas9

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

No branches or pull requests

2 participants