react-jester
Advanced tools
Comparing version 1.2.1-beta.6 to 1.2.1-beta.7
@@ -1,2 +0,1 @@ | ||
import * as React from 'react'; | ||
import { ContainerTest } from '../types'; | ||
@@ -8,6 +7,5 @@ /** | ||
* @param {string} description - The description for this block of container tests | ||
* @param {TContext} Context - The React.Context | ||
* @param {ContainerTest<TContainer, TState>[]} tests - Array of functions that return test configurations | ||
* @returns {void} | ||
*/ | ||
export declare const testContainer: <TContext, TContainer>(description: string, Context: React.Context<TContext>, tests: ContainerTest<TContext, TContainer>[]) => void; | ||
export declare const testContainer: <TContext, TContainer>(description: string, tests: ContainerTest<TContext, TContainer>[]) => void; |
@@ -11,3 +11,2 @@ "use strict"; | ||
* @param {string} description - The description for this block of container tests | ||
* @param {TContext} Context - The React.Context | ||
* @param {ContainerTest<TContainer, TState>[]} tests - Array of functions that return test configurations | ||
@@ -18,3 +17,3 @@ * @returns {void} | ||
*/ | ||
var testContainer = function (description, Context, tests) { | ||
var testContainer = function (description, tests) { | ||
afterAll(function () { | ||
@@ -37,8 +36,7 @@ jest.clearAllMocks(); | ||
it(test_1.description, function () { | ||
var value = test_1.arrange(); | ||
var container = react_test_renderer_1.create(React.createElement(Context.Provider, { value: value }, test_1.container)); | ||
var container = react_test_renderer_1.create(React.createElement(React.Fragment, null, test_1.arrange())); | ||
if (test_1.act) { | ||
test_1.act(container); | ||
} | ||
test_1.assert(container, value); | ||
test_1.assert(container); | ||
}); | ||
@@ -45,0 +43,0 @@ }); |
@@ -35,4 +35,4 @@ import { ReactTestRenderer } from 'react-test-renderer'; | ||
export interface IContextContainerTestConfig<TContext, TContainer = React.ReactNode> extends IContainerTestConfig<TContainer> { | ||
arrange: () => TContext; | ||
assert: (container: ReactTestRenderer, value: TContext) => void; | ||
arrange: () => React.Context<TContext>; | ||
assert: (container: ReactTestRenderer) => void; | ||
} | ||
@@ -39,0 +39,0 @@ export interface IReduxContainerTestConfig<TContainer = React.ReactNode, TState = Record<string, unknown>> extends IContainerTestConfig<TContainer> { |
@@ -1,2 +0,1 @@ | ||
import * as React from 'react'; | ||
import { ContainerTest } from '../types'; | ||
@@ -8,6 +7,5 @@ /** | ||
* @param {string} description - The description for this block of container tests | ||
* @param {TContext} Context - The React.Context | ||
* @param {ContainerTest<TContainer, TState>[]} tests - Array of functions that return test configurations | ||
* @returns {void} | ||
*/ | ||
export declare const testContainer: <TContext, TContainer>(description: string, Context: React.Context<TContext>, tests: ContainerTest<TContext, TContainer>[]) => void; | ||
export declare const testContainer: <TContext, TContainer>(description: string, tests: ContainerTest<TContext, TContainer>[]) => void; |
@@ -8,3 +8,2 @@ import * as React from 'react'; | ||
* @param {string} description - The description for this block of container tests | ||
* @param {TContext} Context - The React.Context | ||
* @param {ContainerTest<TContainer, TState>[]} tests - Array of functions that return test configurations | ||
@@ -15,3 +14,3 @@ * @returns {void} | ||
*/ | ||
export var testContainer = function (description, Context, tests) { | ||
export var testContainer = function (description, tests) { | ||
afterAll(function () { | ||
@@ -34,8 +33,7 @@ jest.clearAllMocks(); | ||
it(test_1.description, function () { | ||
var value = test_1.arrange(); | ||
var container = create(React.createElement(Context.Provider, { value: value }, test_1.container)); | ||
var container = create(React.createElement(React.Fragment, null, test_1.arrange())); | ||
if (test_1.act) { | ||
test_1.act(container); | ||
} | ||
test_1.assert(container, value); | ||
test_1.assert(container); | ||
}); | ||
@@ -42,0 +40,0 @@ }); |
@@ -35,4 +35,4 @@ import { ReactTestRenderer } from 'react-test-renderer'; | ||
export interface IContextContainerTestConfig<TContext, TContainer = React.ReactNode> extends IContainerTestConfig<TContainer> { | ||
arrange: () => TContext; | ||
assert: (container: ReactTestRenderer, value: TContext) => void; | ||
arrange: () => React.Context<TContext>; | ||
assert: (container: ReactTestRenderer) => void; | ||
} | ||
@@ -39,0 +39,0 @@ export interface IReduxContainerTestConfig<TContainer = React.ReactNode, TState = Record<string, unknown>> extends IContainerTestConfig<TContainer> { |
{ | ||
"name": "react-jester", | ||
"version": "1.2.1-beta.6", | ||
"version": "1.2.1-beta.7", | ||
"description": "Utils to help more rapidly create Jest tests for React containers, useReducer, Redux, and action creators by reducing boiler plate", | ||
@@ -5,0 +5,0 @@ "main": "lib/es5/index.js", |
@@ -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.1-beta.6</p> | ||
<p><b>Version:</b> 1.2.1-beta.7</p> | ||
@@ -18,0 +18,0 @@ <h2>Summary of Utils</h2> |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
37673
649