Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-jester

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-jester - npm Package Compare versions

Comparing version 1.2.0 to 1.2.1-beta.0

lib/es5/redux.d.ts

0

CHANGELOG.md

@@ -0,0 +0,0 @@ ## [1.2.0] - 2021-01-30

3

lib/es5/testContainer/index.d.ts

@@ -8,5 +8,4 @@ import { ContainerTest } from '../types';

* @param {ContainerTest<TContainer, TState>[]} tests - Array of functions that return test configurations
* @param {bool} [redux=false] - Whether or not the container connects to redux
* @returns {void}
*/
export declare const testContainer: <TContainer, TState = Record<string, unknown>>(description: string, tests: ContainerTest<TContainer, TState>[], redux?: boolean) => void;
export declare const testContainer: <TContainer, TState = Record<string, unknown>>(description: string, tests: ContainerTest<TContainer, TState>[]) => void;

@@ -5,6 +5,3 @@ "use strict";

var React = require("react");
var react_redux_1 = require("react-redux");
var react_test_renderer_1 = require("react-test-renderer");
var redux_mock_store_1 = require("redux-mock-store");
var redux_thunk_1 = require("redux-thunk");
/**

@@ -16,3 +13,2 @@ * Build and run tests for your containers from an array of test config building functions

* @param {ContainerTest<TContainer, TState>[]} tests - Array of functions that return test configurations
* @param {bool} [redux=false] - Whether or not the container connects to redux
* @returns {void}

@@ -22,11 +18,3 @@ * @docgen_description_note

*/
var testContainer = function (description, tests, redux) {
if (redux === void 0) { redux = false; }
var getReduxProvider = function (state, container) {
// Arrange
var middlewares = [redux_thunk_1.default];
var mockStore = redux_mock_store_1.default(middlewares);
// Act
return react_test_renderer_1.create(React.createElement(react_redux_1.Provider, { store: mockStore(state) }, container));
};
var testContainer = function (description, tests) {
afterAll(function () {

@@ -50,3 +38,3 @@ jest.clearAllMocks();

var state = test_1.arrange();
var container = redux ? getReduxProvider(state, test_1.container) : react_test_renderer_1.create(React.createElement(React.Fragment, null, test_1.container));
var container = react_test_renderer_1.create(React.createElement(React.Fragment, null, test_1.container));
if (test_1.act) {

@@ -53,0 +41,0 @@ test_1.act(container);

@@ -8,5 +8,4 @@ import { ContainerTest } from '../types';

* @param {ContainerTest<TContainer, TState>[]} tests - Array of functions that return test configurations
* @param {bool} [redux=false] - Whether or not the container connects to redux
* @returns {void}
*/
export declare const testContainer: <TContainer, TState = Record<string, unknown>>(description: string, tests: ContainerTest<TContainer, TState>[], redux?: boolean) => void;
export declare const testContainer: <TContainer, TState = Record<string, unknown>>(description: string, tests: ContainerTest<TContainer, TState>[]) => void;
import * as React from 'react';
import { Provider } from 'react-redux';
import { create } from 'react-test-renderer';
import configureMockStore from 'redux-mock-store';
import thunk from 'redux-thunk';
/**

@@ -12,3 +9,2 @@ * Build and run tests for your containers from an array of test config building functions

* @param {ContainerTest<TContainer, TState>[]} tests - Array of functions that return test configurations
* @param {bool} [redux=false] - Whether or not the container connects to redux
* @returns {void}

@@ -18,11 +14,3 @@ * @docgen_description_note

*/
export var testContainer = function (description, tests, redux) {
if (redux === void 0) { redux = false; }
var getReduxProvider = function (state, container) {
// Arrange
var middlewares = [thunk];
var mockStore = configureMockStore(middlewares);
// Act
return create(React.createElement(Provider, { store: mockStore(state) }, container));
};
export var testContainer = function (description, tests) {
afterAll(function () {

@@ -46,3 +34,3 @@ jest.clearAllMocks();

var state = test_1.arrange();
var container = redux ? getReduxProvider(state, test_1.container) : create(React.createElement(React.Fragment, null, test_1.container));
var container = create(React.createElement(React.Fragment, null, test_1.container));
if (test_1.act) {

@@ -49,0 +37,0 @@ test_1.act(container);

{
"name": "react-jester",
"version": "1.2.0",
"version": "1.2.1-beta.0",
"description": "Utils to help more rapidly create Jest tests for React containers, useReducer, Redux, and action creators by reducing boiler plate",

@@ -36,5 +36,2 @@ "main": "lib/es5/index.js",

"dependencies": {
"console-log-it": "^1.1.0",
"redux-mock-store": "^1.5.4",
"redux-thunk": "^2.3.0",
"react-test-renderer": "^17.0.1"

@@ -45,4 +42,6 @@ },

"react": ">=16.8.0",
"react-redux": ">=6.0.0"
"react-redux": ">=6.0.0",
"redux-mock-store": "^1.5.4",
"redux-thunk": "^2.3.0"
}
}

@@ -15,3 +15,3 @@ [![Build Status](https://travis-ci.com/TheSpicyMeatball/react-jester.svg?branch=main)](https://travis-ci.com/TheSpicyMeatball/react-jester)

<p><b>Version:</b> 1.2.0</p>
<p><b>Version:</b> 1.2.1-beta.0</p>

@@ -18,0 +18,0 @@ <h2>Summary of Utils</h2>

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc