# react-router-test-context

> Create a pseudo context to assist in testing components that render React Router's location-aware components.

Latest version **0.1.0** (published 2017-03-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-router-test-context
pnpm add react-router-test-context
yarn add react-router-test-context
bun add react-router-test-context
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2017-03-14 |
| First published | 2017-03-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 48 |
| Author | Paul Sherman |
| Maintainers | pshrmn |
| Keywords | React, React, Router, unit, test |

## Links

- npm: https://www.npmjs.com/package/react-router-test-context
- Repository: https://github.com/pshrmn/react-router-test-context
- Homepage: https://github.com/pshrmn/react-router-test-context#readme
- Issues: https://github.com/pshrmn/react-router-test-context/issues
- npm.io page: https://npm.io/package/react-router-test-context

## Alternatives

- [duck](https://npm.io/package/duck.md) — 4.2M weekly downloads
- [ava](https://npm.io/package/ava.md) — 560.2K weekly downloads
- [storybook-addon-module-mock](https://npm.io/package/storybook-addon-module-mock.md) — 71.7K weekly downloads
- [vest](https://npm.io/package/vest.md) — 50.1K weekly downloads
- [@ethereum-waffle/mock-contract](https://npm.io/package/@ethereum-waffle/mock-contract.md) — 40.0K weekly downloads

## Recent versions

- 0.1.0 (latest) — 2017-03-14

## 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

```js
import createRouterContext from 'react-router-test-context'
import { shallow } from 'enzyme'

describe('my test', () => {
  it('renders', () => {
    const context = createRouterContext()
    const wrapper = shallow(<MyComponent />, { context })
    // ...
  })
})
```

---
_Source: https://npm.io/package/react-router-test-context · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
