![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
redux-action-asserter
Advanced tools
I found myself using redux-mock-store a lot when writing
semi-integrated tests, where I was testing a connected component inside a react-redux
Provider
.
This works great when you're interacting with the store directly, but is less useful when you're
writing tests that set up more than one connected component and want to test their interaction
with at least partial isolation.
The benefit of this middleware is that it lets you use your actual store configuration, updating state, and re-rendering connected components with new props, but also assert on sync or async actions.
npm install redux-test-action-log --save-dev
While this module provides a redux middleware, it exists as a constructor with a few extra features. This gives you access to the assertion functions and encapsulates the action log between tests.
import {createStore, applyMiddleware} from 'redux'
import ActionAsserter from 'redux-action-asserter'
const actionAsserter = new ActionAsserter()
// Basic no-op test reducer. You would typically use your application reducer her
const myReducer = state => state
const store = createStore(myReducer, applyMiddleware(actionAsserter.middleware()))
// ...Do some stuff that dispatches normal actions
actionAsserter.getActions()
// -> [an, array, of, dispatched, actions]
If you're using the redux-thunk middleware, you can also use resolve
to
create a thennable that will resolve when all dispatched thunks have resolved. Note to use this feature, your thunk
must return a Promise.
import {createStore, applyMiddleware} from 'redux'
import thunk from 'redux-thunk'
import ActionAsserter from 'redux-action-asserter'
const actionAsserter = new ActionAsserter()
// Basic no-op test reducer. You would typically use your application reducer her
const myReducer = state => state
const store = createStore(myReducer, applyMiddleware(thunk, actionAsserter.middleware()))
const afterAsyncAction = {type: 'after-async'}
const myThunk = () => dispatch => {
return Promise.resolve().then(() => {
dispatch(afterAsyncAction)
})
}
store.dispatch(myThunk())
actionAsserter.resolve().then(() => {
store.getActions()
// [afterAsyncAction]
})
FAQs
## Why Does This Exist?
The npm package redux-action-asserter receives a total of 1 weekly downloads. As such, redux-action-asserter popularity was classified as not popular.
We found that redux-action-asserter demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.