Socket
Socket
Sign inDemoInstall

ra-test

Package Overview
Dependencies
82
Maintainers
2
Versions
41
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.18.3 to 4.0.0-alpha.0

LICENSE.md

3

esm/renderHook.js

@@ -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": "4.0.0-alpha.0",
"description": "Test utilities for react-admin, a frontend Framework for building admin applications on top of REST services, using ES6, React",

@@ -30,3 +30,2 @@ "files": [

"devDependencies": {
"@redux-saga/testing-utils": "^1.0.2",
"@types/history": "^4.7.2",

@@ -43,3 +42,3 @@ "@types/node-polyglot": "^0.4.31",

"ignore-styles": "~5.0.1",
"ra-core": "^3.18.3",
"ra-core": "^4.0.0-alpha.0",
"react": "^17.0.0",

@@ -66,3 +65,4 @@ "react-dom": "^17.0.0",

"lodash": "~4.17.5"
}
},
"gitHead": "1e0006ef5b4d7e977ed6e372f7f3146a11a0c312"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc