@truedat/test 4.41.0 → 4.41.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [4.41.4] 2022-04-04
4
+
5
+ ### Changed
6
+
7
+ - Test renderer can now be passed `routes` and `routeIndex` for bootstrapping
8
+ the `MemoryRouter`
9
+
3
10
  ## [4.18.2] 2021-04-19
4
11
 
5
12
  ### Added
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@truedat/test",
3
- "version": "4.41.0",
3
+ "version": "4.41.4",
4
4
  "description": "Truedat Web Test",
5
5
  "sideEffects": false,
6
6
  "jsnext:main": "src/index.js",
@@ -94,5 +94,5 @@
94
94
  "react": ">= 16.8.6 < 17",
95
95
  "react-dom": ">= 16.8.6 < 17"
96
96
  },
97
- "gitHead": "f4d8bc5e536b847c7b562a84bfa70955a93166ea"
97
+ "gitHead": "c7038921dceb3cb9d6950fd9f57b23126ee0d8b0"
98
98
  }
package/src/render.js CHANGED
@@ -8,13 +8,21 @@ import { MemoryRouter } from "react-router-dom";
8
8
 
9
9
  const customRender = (
10
10
  component,
11
- { locale = "en", mocks = [], state = {}, messages = {}, ...renderOptions }
11
+ {
12
+ locale = "en",
13
+ mocks = [],
14
+ state = {},
15
+ messages = {},
16
+ routes = ["/"],
17
+ routeIndex,
18
+ ...renderOptions
19
+ }
12
20
  ) => {
13
21
  const store = createStore(() => state);
14
22
  // eslint-disable-next-line react/prop-types
15
23
  function Wrapper({ children }) {
16
24
  return (
17
- <MemoryRouter>
25
+ <MemoryRouter initialEntries={routes} initialIndex={routeIndex}>
18
26
  <IntlProvider
19
27
  locale={locale}
20
28
  defaultLocale={locale}