apply eslint and prettier rules

This commit is contained in:
Sebastian Sdorra
2019-10-21 10:57:56 +02:00
parent 85773186db
commit 4bb8e6153b
227 changed files with 1147 additions and 4076 deletions

View File

@@ -50,9 +50,7 @@ describe("ExtensionPoint test", () => {
mockedBinder.hasExtension.mockReturnValue(true);
mockedBinder.getExtensions.mockReturnValue([labelOne, labelTwo]);
const rendered = mount(
<ExtensionPointEnzymeFix name="something.special" renderAll={true} />
);
const rendered = mount(<ExtensionPointEnzymeFix name="something.special" renderAll={true} />);
const text = rendered.text();
expect(text).toContain("Extension One");
expect(text).toContain("Extension Two");
@@ -123,11 +121,7 @@ describe("ExtensionPoint test", () => {
};
const HelloUser = () => {
return (
<UserContext.Consumer>
{({ name }) => <Hello name={name} />}
</UserContext.Consumer>
);
return <UserContext.Consumer>{({ name }) => <Hello name={name} />}</UserContext.Consumer>;
};
mockedBinder.hasExtension.mockReturnValue(true);

View File

@@ -41,25 +41,13 @@ describe("binder tests", () => {
});
type Props = {
category: string
category: string;
};
it("should return only extensions which predicates matches", () => {
binder.bind(
"hitchhicker.trillian",
"heartOfGold",
(props: Props) => props.category === "a"
);
binder.bind(
"hitchhicker.trillian",
"earth",
(props: Props) => props.category === "b"
);
binder.bind(
"hitchhicker.trillian",
"earth2",
(props: Props) => props.category === "a"
);
binder.bind("hitchhicker.trillian", "heartOfGold", (props: Props) => props.category === "a");
binder.bind("hitchhicker.trillian", "earth", (props: Props) => props.category === "b");
binder.bind("hitchhicker.trillian", "earth2", (props: Props) => props.category === "a");
const extensions = binder.getExtensions("hitchhicker.trillian", {
category: "b"

View File

@@ -31,7 +31,7 @@ export class Binder {
}
const registration = {
predicate: predicate ? predicate : () => true,
extension,
extension
};
this.extensionPoints[extensionPoint].push(registration);
}