Skip to content
This repository was archived by the owner on May 17, 2019. It is now read-only.
This repository was archived by the owner on May 17, 2019. It is now read-only.

MemoryRouter does not provide onRoute context #221

@aliaksandr-kazarez

Description

@aliaksandr-kazarez

Type of issue

Bug

Description

MemoryRouter does not provide onRoute into child context
Besides it would be nice to be able to override onRoute with some mock function

Current behavior

When using MemoryRouter for UnitTesting it fails with following error:
TypeError: context.onRoute is not a function

Expected behavior

Should not fails on this step

Steps to reproduce

run following test snippet:

    const component = mount(
      <MemoryRouter initialEntries={['/test']}>
        <Route path="/test" render={() => <div>Test</div>} />
      </MemoryRouter>
    );

    expect(component.find('div').text()).toBe('Test');

Your environment

  • fusion-plugin-react-router version: 1.2.0

  • Node.js version (node --version): 8.14

  • npm version (npm --version): 6.4.1

  • Operating System: OSX

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions