ra-test
Advanced tools
Comparing version 3.18.3 to 3.19.0
@@ -30,6 +30,5 @@ var __assign = (this && this.__assign) || function () { | ||
: render(React.createElement(TestHook, { children: childrenMock, hook: hook })); | ||
return __assign(__assign({}, result), { hookValue: hookValue, | ||
childrenMock: childrenMock, rerender: function (newHook) { | ||
return __assign(__assign({}, result), { hookValue: hookValue, childrenMock: childrenMock, rerender: function (newHook) { | ||
result.rerender(React.createElement(TestHook, { children: childrenMock, hook: newHook })); | ||
} }); | ||
} |
@@ -60,4 +60,3 @@ var __assign = (this && this.__assign) || function () { | ||
})); | ||
}, dispatch: dispatch, | ||
reduxStore: reduxStore }); | ||
}, dispatch: dispatch, reduxStore: reduxStore }); | ||
}; |
@@ -0,1 +1,2 @@ | ||
import * as React from 'react'; | ||
import { Component, ReactNode } from 'react'; | ||
@@ -56,3 +57,3 @@ import { Store } from 'redux'; | ||
constructor(props: any); | ||
renderChildren: () => {}; | ||
renderChildren: () => React.ReactNode; | ||
render(): JSX.Element; | ||
@@ -59,0 +60,0 @@ } |
@@ -9,2 +9,4 @@ var __extends = (this && this.__extends) || (function () { | ||
return function (d, b) { | ||
if (typeof b !== "function" && b !== null) | ||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); | ||
extendStatics(d, b); | ||
@@ -11,0 +13,0 @@ function __() { this.constructor = d; } |
@@ -50,6 +50,5 @@ "use strict"; | ||
var result = withRedux | ||
? renderWithRedux_1.renderWithRedux(React.createElement(TestHook, { children: childrenMock, hook: hook }), reduxState) | ||
: react_1.render(React.createElement(TestHook, { children: childrenMock, hook: hook })); | ||
return __assign(__assign({}, result), { hookValue: hookValue, | ||
childrenMock: childrenMock, rerender: function (newHook) { | ||
? (0, renderWithRedux_1.renderWithRedux)(React.createElement(TestHook, { children: childrenMock, hook: hook }), reduxState) | ||
: (0, react_1.render)(React.createElement(TestHook, { children: childrenMock, hook: hook })); | ||
return __assign(__assign({}, result), { hookValue: hookValue, childrenMock: childrenMock, rerender: function (newHook) { | ||
result.rerender(React.createElement(TestHook, { children: childrenMock, hook: newHook })); | ||
@@ -56,0 +55,0 @@ } }); |
@@ -66,3 +66,3 @@ "use strict"; | ||
*/ | ||
exports.renderWithRedux = function (component, initialState, options, customReducers) { | ||
var renderWithRedux = function (component, initialState, options, customReducers) { | ||
if (initialState === void 0) { initialState = {}; } | ||
@@ -73,3 +73,3 @@ if (options === void 0) { options = {}; } | ||
var reduxStore; | ||
var renderResult = react_1.render(React.createElement(TestContext_1.default, { initialState: initialState, customReducers: customReducers, enableReducers: true }, function (_a) { | ||
var renderResult = (0, react_1.render)(React.createElement(TestContext_1.default, { initialState: initialState, customReducers: customReducers, enableReducers: true }, function (_a) { | ||
var store = _a.store; | ||
@@ -87,4 +87,4 @@ dispatch = jest.spyOn(store, 'dispatch'); | ||
})); | ||
}, dispatch: dispatch, | ||
reduxStore: reduxStore }); | ||
}, dispatch: dispatch, reduxStore: reduxStore }); | ||
}; | ||
exports.renderWithRedux = renderWithRedux; |
@@ -0,1 +1,2 @@ | ||
import * as React from 'react'; | ||
import { Component, ReactNode } from 'react'; | ||
@@ -56,3 +57,3 @@ import { Store } from 'redux'; | ||
constructor(props: any); | ||
renderChildren: () => {}; | ||
renderChildren: () => React.ReactNode; | ||
render(): JSX.Element; | ||
@@ -59,0 +60,0 @@ } |
@@ -10,2 +10,4 @@ "use strict"; | ||
return function (d, b) { | ||
if (typeof b !== "function" && b !== null) | ||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); | ||
extendStatics(d, b); | ||
@@ -96,14 +98,14 @@ function __() { this.constructor = d; } | ||
}; | ||
_this.history = props.history || history_1.createMemoryHistory(); | ||
_this.history = props.history || (0, history_1.createMemoryHistory)(); | ||
var _a = props.initialState, initialState = _a === void 0 ? {} : _a, _b = props.enableReducers, enableReducers = _b === void 0 ? false : _b, _c = props.customReducers, customReducers = _c === void 0 ? {} : _c; | ||
_this.storeWithDefault = enableReducers | ||
? ra_core_1.createAdminStore({ | ||
initialState: merge_1.default({}, exports.defaultStore, initialState), | ||
dataProvider: ra_core_1.convertLegacyDataProvider(function () { | ||
? (0, ra_core_1.createAdminStore)({ | ||
initialState: (0, merge_1.default)({}, exports.defaultStore, initialState), | ||
dataProvider: (0, ra_core_1.convertLegacyDataProvider)(function () { | ||
return Promise.resolve(dataProviderDefaultResponse); | ||
}), | ||
history: history_1.createMemoryHistory(), | ||
history: (0, history_1.createMemoryHistory)(), | ||
customReducers: customReducers, | ||
}) | ||
: redux_1.createStore(function () { return merge_1.default({}, exports.defaultStore, initialState); }); | ||
: (0, redux_1.createStore)(function () { return (0, merge_1.default)({}, exports.defaultStore, initialState); }); | ||
return _this; | ||
@@ -110,0 +112,0 @@ } |
{ | ||
"name": "ra-test", | ||
"version": "3.18.3", | ||
"version": "3.19.0", | ||
"description": "Test utilities for react-admin, a frontend Framework for building admin applications on top of REST services, using ES6, React", | ||
@@ -42,3 +42,3 @@ "files": [ | ||
"ignore-styles": "~5.0.1", | ||
"ra-core": "^3.18.3", | ||
"ra-core": "^3.19.0", | ||
"react": "^17.0.0", | ||
@@ -45,0 +45,0 @@ "react-dom": "^17.0.0", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
56601
1101
0