Skip to content

test(store): added test coverage for createStore with custom middleware chaining - #43

Open
tmdeveloper007 wants to merge 5 commits into
mainfrom
#3293
Open

test(store): added test coverage for createStore with custom middleware chaining#43
tmdeveloper007 wants to merge 5 commits into
mainfrom
#3293

Conversation

@tmdeveloper007

Copy link
Copy Markdown
Owner

Summary of What Has Been Done

Added with 8 test cases covering createStore with custom middleware chaining.

Changes Made

  • Created with 8 test cases:
    • Single middleware receives prevState and update correctly
    • Middleware can transform updates before passing to next()
    • Two middleware chain in correct order (first before second before, second after first after)
    • Middleware can access both prevState and nextState
    • Throwing in middleware correctly propagates the error
    • Middleware that does not call next() blocks state updates
    • Empty middleware array behaves like no middleware
    • Multiple sequential updates with middleware capture correct prevState snapshots

Impact it Made

  • Documents the middleware API contract for custom middleware authors
  • Ensures middleware chaining order is predictable
  • Covers a critical extensibility feature that lacked test coverage

Closes Karanjot786#3293.

Note: please assign this PR to the tmdeveloper007 account.

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.

test(store): add test coverage for createStore with custom middleware chaining

1 participant