Skip to content

Commit 7022021

Browse files
Upgraded prettier dependency
1 parent 9ea0245 commit 7022021

9 files changed

Lines changed: 37 additions & 37 deletions

index.d.mts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import TestRenderer from "react-test-renderer";
33

44
export function assertComponent(
55
result: TestRenderer.ReactTestInstance | string,
6-
expectedElement: React.ReactElement | string
6+
expectedElement: React.ReactElement | string,
77
): void;
88

99
export function assertComponents(
@@ -12,7 +12,7 @@ export function assertComponents(
1212
): void;
1313

1414
export function mockComponent<
15-
T = React.FunctionComponent<any> | React.ComponentClass<any>
15+
T = React.FunctionComponent<any> | React.ComponentClass<any>,
1616
>(comp: T, name?: string): T;
1717

1818
export function actAsync<T>(callback: () => T): Promise<T>;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"@types/react-test-renderer": "^17.0.1",
4444
"c8": "^7.13.0",
4545
"mock-fn": "^1.0.0",
46-
"prettier": "^2.8.8",
46+
"prettier": "^3.8.1",
4747
"react": "^17.0.1",
4848
"react-test-renderer": "^17.0.1",
4949
"typescript": "^4.9.5"

src/assertComponent.mjs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ function assertComponentImpl(path, result, expectedElement) {
2626
typeof expectedElement === "string"
2727
? expectedElement
2828
: expectedElement.type.displayName
29-
? expectedElement.type.displayName
30-
: expectedElement.type;
29+
? expectedElement.type.displayName
30+
: expectedElement.type;
3131

3232
const pathName = path ? `${path} > ${name}` : Object(name).toString();
3333

@@ -36,7 +36,7 @@ function assertComponentImpl(path, result, expectedElement) {
3636
assert.fail(
3737
`Element doesn't match for ${pathName}` +
3838
`\n\tactual: ${result}` +
39-
`\n\texpected: ${expectedElement}`
39+
`\n\texpected: ${expectedElement}`,
4040
);
4141
}
4242
return;
@@ -52,7 +52,7 @@ function assertComponentImpl(path, result, expectedElement) {
5252
expectedElement.type.displayName
5353
? expectedElement.type.displayName
5454
: expectedElement.type
55-
}`
55+
}`,
5656
);
5757
}
5858

@@ -80,15 +80,15 @@ function assertComponentImpl(path, result, expectedElement) {
8080
: Object(child.type).toString();
8181
});
8282
assert.fail(
83-
`Expected no children for ${pathName}, but got: ${resultChildren}`
83+
`Expected no children for ${pathName}, but got: ${resultChildren}`,
8484
);
8585
}
8686
} else {
8787
if (children.length !== expectedChildren.length) {
8888
assert.fail(
8989
`Children count doesn't match for ${pathName}` +
9090
`\n\tactual: ${children.length}` +
91-
`\n\texpected: ${expectedChildren.length}`
91+
`\n\texpected: ${expectedChildren.length}`,
9292
);
9393
}
9494

@@ -167,7 +167,7 @@ function assertAttrValue(name, resultValue, expectedValue) {
167167
expectedValue,
168168
`Attribute value doesn't match for ${name}` +
169169
`\n\tactual: ${resultValue}` +
170-
`\n\texpected: ${expectedValue}`
170+
`\n\texpected: ${expectedValue}`,
171171
);
172172
}
173173

src/assertComponents.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ function assertComponents(results, ...expectedElements) {
1010
assert.fail(
1111
`Components count doesn't match` +
1212
`\n\tactual: ${results.length}` +
13-
`\n\texpected: ${expectedElements.length}`
13+
`\n\texpected: ${expectedElements.length}`,
1414
);
1515
}
1616

test/TestErrorBoundary.test.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ describe("TestErrorBoundary.test.mjs", () => {
1919
it("should render children if no errors", () => {
2020
//when
2121
const result = TestRenderer.create(
22-
h(TestErrorBoundary, null, "some child")
22+
h(TestErrorBoundary, null, "some child"),
2323
).root;
2424

2525
//then
@@ -43,7 +43,7 @@ describe("TestErrorBoundary.test.mjs", () => {
4343

4444
//when
4545
const result = TestRenderer.create(
46-
h(TestErrorBoundary, null, h(ErrorComp))
46+
h(TestErrorBoundary, null, h(ErrorComp)),
4747
).root;
4848

4949
//then

test/assertComponent.test.mjs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ describe("assertComponent.test.mjs", () => {
3838
new RegExp(
3939
"Attribute value doesn't match for p\\.testArr\\.0" +
4040
"\n\tactual: test1" +
41-
"\n\texpected: test2"
42-
)
41+
"\n\texpected: test2",
42+
),
4343
);
4444
});
4545

@@ -69,8 +69,8 @@ describe("assertComponent.test.mjs", () => {
6969
new RegExp(
7070
"Attribute value doesn't match for p\\.testObj\\.test" +
7171
"\n\tactual: 1" +
72-
"\n\texpected: 2"
73-
)
72+
"\n\texpected: 2",
73+
),
7474
);
7575
});
7676

@@ -100,8 +100,8 @@ describe("assertComponent.test.mjs", () => {
100100
new RegExp(
101101
"Attribute value doesn't match for p\\.testObj\\.test" +
102102
"\n\tactual: \\(\\) => 1" +
103-
"\n\texpected: undefined"
104-
)
103+
"\n\texpected: undefined",
104+
),
105105
);
106106
});
107107

@@ -129,8 +129,8 @@ describe("assertComponent.test.mjs", () => {
129129
new RegExp(
130130
"Attribute value doesn't match for p\\.disabled" +
131131
"\n\tactual: true" +
132-
"\n\texpected: false"
133-
)
132+
"\n\texpected: false",
133+
),
134134
);
135135
});
136136

@@ -155,7 +155,7 @@ describe("assertComponent.test.mjs", () => {
155155
resError?.message,
156156
"Element doesn't match for p > comp2" +
157157
"\n\tactual: comp" +
158-
"\n\texpected: comp2"
158+
"\n\texpected: comp2",
159159
);
160160
});
161161

@@ -180,7 +180,7 @@ describe("assertComponent.test.mjs", () => {
180180
resError?.message,
181181
"Component type doesn't match for comp2" +
182182
"\n\tactual: comp" +
183-
"\n\texpected: comp2"
183+
"\n\texpected: comp2",
184184
);
185185
});
186186

@@ -205,7 +205,7 @@ describe("assertComponent.test.mjs", () => {
205205
resError?.message,
206206
"Component type doesn't match for p > TestComp2" +
207207
"\n\tactual: TestComp" +
208-
"\n\texpected: TestComp2"
208+
"\n\texpected: TestComp2",
209209
);
210210
});
211211

@@ -230,7 +230,7 @@ describe("assertComponent.test.mjs", () => {
230230
resError?.message,
231231
"Children count doesn't match for p > hr" +
232232
"\n\tactual: 1" +
233-
"\n\texpected: 2"
233+
"\n\texpected: 2",
234234
);
235235
});
236236

@@ -255,7 +255,7 @@ describe("assertComponent.test.mjs", () => {
255255
resError?.message,
256256
"Children count doesn't match for p" +
257257
"\n\tactual: 0" +
258-
"\n\texpected: 1"
258+
"\n\texpected: 1",
259259
);
260260
});
261261

@@ -278,7 +278,7 @@ describe("assertComponent.test.mjs", () => {
278278
//then
279279
assert.deepEqual(
280280
resError?.message,
281-
"Expected no children for p, but got: test_text,div,TestComp"
281+
"Expected no children for p, but got: test_text,div,TestComp",
282282
);
283283
});
284284

@@ -312,7 +312,7 @@ describe("assertComponent.test.mjs", () => {
312312
},
313313
}),
314314
h("div", {}, "child1"),
315-
h("div", {}, "child2")
315+
h("div", {}, "child2"),
316316
);
317317
};
318318
const comp = TestRenderer.create(h(Comp)).root.children[0];
@@ -346,8 +346,8 @@ describe("assertComponent.test.mjs", () => {
346346
},
347347
}),
348348
h("div", {}, "child1"),
349-
h("div", {}, "child2")
350-
)
349+
h("div", {}, "child2"),
350+
),
351351
);
352352
});
353353
});

test/assertComponents.test.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ describe("assertComponents.test.mjs", () => {
3535
//then
3636
assert.deepEqual(
3737
resError?.message,
38-
"Components count doesn't match\n\tactual: 3\n\texpected: 2"
38+
"Components count doesn't match\n\tactual: 3\n\texpected: 2",
3939
);
4040
});
4141

@@ -60,7 +60,7 @@ describe("assertComponents.test.mjs", () => {
6060
resError?.message,
6161
"Component type doesn't match for p > TestComp2" +
6262
"\n\tactual: TestComp" +
63-
"\n\texpected: TestComp2"
63+
"\n\texpected: TestComp2",
6464
);
6565
});
6666

test/testComponents.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const TestComp = (props) => {
1111
{
1212
className: "test1",
1313
},
14-
props.children
14+
props.children,
1515
);
1616
};
1717
TestComp.displayName = "TestComp";
@@ -25,7 +25,7 @@ const TestComp2 = (props) => {
2525
{
2626
className: "test2",
2727
},
28-
props.children
28+
props.children,
2929
);
3030
};
3131
TestComp2.displayName = "TestComp2";

test/testRenderer.test.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ describe("testRenderer.test.mjs", () => {
3131
//then
3232
assert.deepEqual(
3333
resError?.message,
34-
'No instances found with node type: "button"'
34+
'No instances found with node type: "button"',
3535
);
3636
});
3737

3838
it("should find nested simple component when findByType", () => {
3939
//given
4040
const comp = TestRenderer.create(
41-
h(TestComp, {}, h(TestComp, {}, h("button", { show: true })))
41+
h(TestComp, {}, h(TestComp, {}, h("button", { show: true }))),
4242
).root;
4343

4444
//when
@@ -51,7 +51,7 @@ describe("testRenderer.test.mjs", () => {
5151
it("should find nested react component when findByType", () => {
5252
//given
5353
const comp = TestRenderer.create(
54-
h(TestComp, {}, h(TestComp2, { show: true }))
54+
h(TestComp, {}, h(TestComp2, { show: true })),
5555
).root;
5656

5757
//when

0 commit comments

Comments
 (0)