mirror of
https://github.com/bendtherules/react-fiber-traverse.git
synced 2026-08-18 13:52:36 +00:00
Fix prettier on all files
This commit is contained in:
@@ -17,7 +17,7 @@ describe("Component", () => {
|
||||
it("should render correctly", () => {
|
||||
const rootRef = React.createRef<C>();
|
||||
|
||||
rootRef.current && rootRef.current
|
||||
rootRef.current && rootRef.current;
|
||||
|
||||
wrapper = mount(<C text="text" ref={rootRef} />, { attachTo: container });
|
||||
expect(wrapper.html()).toMatchSnapshot();
|
||||
|
||||
@@ -85,7 +85,7 @@ describe("findNodeByComponentName", () => {
|
||||
const rootNode = mountAndGetRootNode(WrappedC, container);
|
||||
|
||||
const foundFnDepth1 = findNodeByComponentName(rootNode, FnDepth1.name);
|
||||
const foundInner = findNodeByComponentName(foundFnDepth1, 'someName');
|
||||
const foundInner = findNodeByComponentName(foundFnDepth1, "someName");
|
||||
|
||||
expect(foundInner).toBeFalsy();
|
||||
expect(foundInner).toBe(null);
|
||||
@@ -96,7 +96,12 @@ describe("findNodeByComponentName", () => {
|
||||
return <Fn2 />;
|
||||
}
|
||||
function Fn2() {
|
||||
return <div>Fn2 here<Fn3/></div>;
|
||||
return (
|
||||
<div>
|
||||
Fn2 here
|
||||
<Fn3 />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
function Fn3() {
|
||||
return <div>Fn3 here</div>;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
function FnDepth1() {
|
||||
return null;
|
||||
return null;
|
||||
}
|
||||
|
||||
export default FnDepth1;
|
||||
|
||||
@@ -13,7 +13,7 @@ import { mountAndGetRootNode } from "./utils/mountInEnzyme";
|
||||
import CDepth1 from "./sample-components/depth-1-simple";
|
||||
import CDepth2 from "./sample-components/depth-2-simple";
|
||||
import CDepth5 from "./sample-components/depth-5-simple";
|
||||
import FnDepth1 from './sample-components/depth-1-fn-simple';
|
||||
import FnDepth1 from "./sample-components/depth-1-fn-simple";
|
||||
|
||||
describe("traverseGenerator", () => {
|
||||
let container: HTMLDivElement;
|
||||
|
||||
@@ -9,7 +9,7 @@ function createFunctionComponent(name?: string): React.FunctionComponent {
|
||||
if (props.children !== undefined) {
|
||||
return <React.Fragment>{props.children}</React.Fragment>;
|
||||
} else {
|
||||
return null
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -31,7 +31,7 @@ function createClassComponent(name?: string): React.ComponentClass {
|
||||
if (this.props.children !== undefined) {
|
||||
return this.props.children;
|
||||
} else {
|
||||
return null
|
||||
return null;
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -113,7 +113,7 @@ function createClassComponents(
|
||||
|
||||
return returnArr;
|
||||
}
|
||||
|
||||
|
||||
// Handle other invalid inputs
|
||||
throw new TypeError("Input is not valid");
|
||||
}
|
||||
|
||||
@@ -9,4 +9,4 @@ function getWrappedComponent(SomeComponent: React.ElementType) {
|
||||
return WrappedC;
|
||||
}
|
||||
|
||||
export default getWrappedComponent;
|
||||
export default getWrappedComponent;
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
import * as React from "react";
|
||||
import { mount } from "enzyme";
|
||||
import { FiberNode, FiberNodeForComponentClass } from "../../src/mocked-types";
|
||||
import {
|
||||
isConstructorFunctionComponent
|
||||
} from "../../src/utils";
|
||||
import { isConstructorFunctionComponent } from "../../src/utils";
|
||||
import getWrappedComponent from "./getWrappedComponent";
|
||||
|
||||
export class RootNodeNotFoundError extends Error {
|
||||
|
||||
Reference in New Issue
Block a user