Skip to content

Commit 5959b54

Browse files
[AUTOMATED]: Prettier Code Styling
1 parent 957056e commit 5959b54

File tree

1 file changed

+51
-38
lines changed

1 file changed

+51
-38
lines changed

packages/firestore/test/integration/api/validation.test.ts

Lines changed: 51 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -30,52 +30,65 @@ import {
3030
// We're using 'as any' to pass invalid values to APIs for testing purposes.
3131
// tslint:disable:no-any
3232

33-
interface ValidationIt {
34-
(persistence: boolean, message: string, testFunction: (db: firestore.FirebaseFirestore) => void | Promise<any>) : void,
35-
skip: (persistence: boolean,
36-
message: string,
37-
testFunction: (db: firestore.FirebaseFirestore) => void | Promise<any>) => void,
38-
only: (persistence: boolean,
39-
message: string,
40-
testFunction: (db: firestore.FirebaseFirestore) => void | Promise<any>) => void
33+
interface ValidationIt {
34+
(
35+
persistence: boolean,
36+
message: string,
37+
testFunction: (db: firestore.FirebaseFirestore) => void | Promise<any>
38+
): void;
39+
skip: (
40+
persistence: boolean,
41+
message: string,
42+
testFunction: (db: firestore.FirebaseFirestore) => void | Promise<any>
43+
) => void;
44+
only: (
45+
persistence: boolean,
46+
message: string,
47+
testFunction: (db: firestore.FirebaseFirestore) => void | Promise<any>
48+
) => void;
4149
}
4250

4351
// Since most of our tests are "synchronous" but require a Firestore instance,
4452
// we have a helper wrapper around it() and withTestDb() to optimize for that.
4553
const validationIt: ValidationIt = Object.assign(
46-
(persistence: boolean,
54+
(
55+
persistence: boolean,
56+
message: string,
57+
testFunction: (db: firestore.FirebaseFirestore) => void | Promise<any>
58+
) => {
59+
it(message, () => {
60+
return withTestDb(persistence, async db => {
61+
const maybePromise = testFunction(db);
62+
if (maybePromise) {
63+
return maybePromise;
64+
}
65+
});
66+
});
67+
},
68+
{
69+
skip: function(
70+
persistence: boolean,
4771
message: string,
48-
testFunction: (db: firestore.FirebaseFirestore) => void | Promise<any>) => {
49-
it(message, () => {
50-
return withTestDb(persistence, async db => {
51-
const maybePromise = testFunction(db);
52-
if (maybePromise) {
53-
return maybePromise;
54-
}
55-
});
56-
});
57-
},
58-
{
59-
skip: function (persistence: boolean,
60-
message: string,
61-
_: (db: firestore.FirebaseFirestore) => void | Promise<any>) {
62-
it.skip(message, () => {
63-
});
64-
},
65-
only: function (persistence: boolean,
66-
message: string,
67-
testFunction: (db: firestore.FirebaseFirestore) => void | Promise<any>) {
68-
it.only(message, () => {
69-
return withTestDb(persistence, async db => {
70-
const maybePromise = testFunction(db);
71-
if (maybePromise) {
72-
return maybePromise;
73-
}
74-
});
72+
_: (db: firestore.FirebaseFirestore) => void | Promise<any>
73+
) {
74+
it.skip(message, () => {});
75+
},
76+
only: function(
77+
persistence: boolean,
78+
message: string,
79+
testFunction: (db: firestore.FirebaseFirestore) => void | Promise<any>
80+
) {
81+
it.only(message, () => {
82+
return withTestDb(persistence, async db => {
83+
const maybePromise = testFunction(db);
84+
if (maybePromise) {
85+
return maybePromise;
86+
}
7587
});
76-
}
88+
});
7789
}
78-
);
90+
}
91+
);
7992

8093
// NOTE: The JS SDK does extensive validation of argument counts, types, etc.
8194
// since it is an untyped language. These tests are not exhaustive as that would

0 commit comments

Comments
 (0)