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

[Reducer Protocol] - Add New Test Cases #68

Merged
merged 12 commits into from
Nov 15, 2022

Conversation

dikasetiadi
Copy link
Contributor

@dikasetiadi dikasetiadi commented Nov 14, 2022

Changes:

  • Update test cases using new reducer protocol implementation
  • Fix Async await action test can't be cancelled
  • Add more test case for StoreTests & TestStoreTests
  • update failingWhenNothingChanges flag to true on new TestStore code
  • Separate the StoreTests & TestStoreTests into different files both for useNewScope value true and false

@dikasetiadi dikasetiadi self-assigned this Nov 14, 2022
@dikasetiadi dikasetiadi changed the base branch from reducer_protocol to feature/reducer_protocol November 14, 2022 03:42
@dikasetiadi dikasetiadi marked this pull request as ready for review November 14, 2022 09:22
Copy link
Contributor

@adityadaniel adityadaniel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

other than that, LGTM 🚀

@@ -1,5 +1,6 @@
import RxSwift
import XCTest
import Combine
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

expected to import combine?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wkwkwk, just trying things with Combine Effect this morning, please remove this dik

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah my bad guys 🤣 removed on next commit yaa

Comment on lines 399 to 416
internal func testStateAccess_useNewScope() async {
enum Action { case a, b, c, d }

let store = TestStore(
initialState: 0,
reducer: Reduce<Int, Action>({ count, action in
switch action {
case .a:
count += 1
return .merge(.init(value: .b), .init(value: .c), .init(value: .d))
case .b, .c, .d:
count += 1
return .none
}
}),
useNewScope: true
)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think better to create separate file for oldScope dik, and for this file, use newScope

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, we can do that @jeffersonsetiawan on next commit ya

@jeffersonsetiawan jeffersonsetiawan merged commit b6dd2eb into feature/reducer_protocol Nov 15, 2022
@jeffersonsetiawan jeffersonsetiawan deleted the feature/poc-update-test branch November 15, 2022 02:39
jeffersonsetiawan added a commit that referenced this pull request Feb 6, 2023
* add dependencies and its test

* update effect and reducer

* add reducers, rename anyreducer, delete xct related files

* extract storeconfig

* task result and task cancellable value

* observable

* effect

* fix package swift

* any disposable

* import xctdynamicoverlay

* update effects

* make any disposable public

* fix any reducer compatibility

* first passed test 5.7

* refactor package.swift

* remove anyequatable double

* update store

* wrap in discardable

* [TestStore] - Update to conform changes ReducerProtocol (#65)

* progress update teststore

* progressing update TestStore

* Fixing TestStore & make it success run test

* update indent code TestStore, add comment for send action assert testStore

* change observable

* update observable

* rename conflicted name

* undo

* add flatmap

* add xctest dynamic overlay podspec

* add xctdo podspec

* update exports.swift

* update podspec

* update typo podspec

* fix dispose issue

* restructure dependency module, fix test, update podspec and package.swift

* update store old behaviour, fix store tests

* remove unused code

* fix flatmap, add StoreOf

* update teststore generics order, remove all spi internals

* Rewrite example using Reducer Protocol style (#63)

* update store, rewrite basic and scoping example

* rewrite environment example

* rewrite pullback vc example

* update counterview, rewrite iflet

* rewrite never equal

* update timer example

* update test

* update old scope and store tests

* use OptionalPath

* remove duplicated StoreConfig

* add ACL for TestReducer class & property

* fix default value for useNewScope in StoreConfig

* [Reducer Protocol] - Add New Test Cases (#68)

* fix passing useNewScope to Store from TestStore

* add new test to TestStore

* add new TestStoreTest cases

* update to fix async task cancel

* update StoreTest test case

* add more StoreTests test cases

* update failingWhenNothingChanges to true by default on new TestStore code

* update & add new cases for TestStoreTest

* remove import combine

* separate oldScope & newScope test on Storetest and TestStoreTest

* update testcases based on new default value for  for Store and TestStore

* [Reducer Protocol] - Support Bootstrap MockKit (#70)

Support our Bootstrap MockKit when using ReducerProtocol Dependency Environment

* update pullback vc

* bump xcode versions

* update ci.yml to use xcode 14.1 for example tests

* update ci yml again for xcode 14.1

* refactor ci.yml

* update xcode 14 1 name

* sync with 0.44.1 minus PR 1510 and EffectTask

* fix warning

* Fix Reducer builder inference issue: pointfreeco/swift-composable-architecture#1591 Implement Test Pt1

* adding more test, still failing dependency test on both store and teststore

* pointfreeco/swift-composable-architecture#1570
pointfreeco/swift-composable-architecture#1575

* add usenewscope

* Sync Cancellation

* Readd PR #1510 and add tests, fix tests examples

* add optional reducer, update dependency values tests with binding

* sync up to 0.46.0

* sync up to 0.47.2

* sync up to 0.48.0

* bump xctestdynamicoverlay

* remove assert function on teststore

* add failing when nothing change on scope teststore

* update store send and mainqueue syntax

---------

Co-authored-by: Andhika Setiadi <[email protected]>
Co-authored-by: Jefferson Setiawan <[email protected]>
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.

3 participants