Package Exports
- react-router-test-context
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-router-test-context) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
react-router-test-context
Create a pseudo context
object that duplicates React Router's context.router
structure. This is useful for shallow unit testing with Enzyme.
Usage
import createRouterContext from 'react-router-test-context'
import { shallow } from 'enzyme'
describe('my test', () => {
it('renders', () => {
const context = createRouterContext()
const wrapper = shallow(<MyComponent />, { context })
// ...
})
})