Skip to content

Commit 95066e9

Browse files
committed
[AUTOMATED]: Prettier Code Styling
1 parent 3bc1698 commit 95066e9

File tree

2 files changed

+36
-29
lines changed

2 files changed

+36
-29
lines changed

packages/testing/src/api/index.ts

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -131,16 +131,20 @@ function initializeApp(
131131
if (accessToken) {
132132
const mockAuthComponent = new Component(
133133
'auth-internal',
134-
() => ({
135-
getToken: () => Promise.resolve({ accessToken: accessToken }),
136-
getUid: () => null,
137-
addAuthTokenListener: () => { },
138-
removeAuthTokenListener: () => { }
139-
}) as FirebaseAuthInternal,
134+
() =>
135+
({
136+
getToken: () => Promise.resolve({ accessToken: accessToken }),
137+
getUid: () => null,
138+
addAuthTokenListener: () => {},
139+
removeAuthTokenListener: () => {}
140+
} as FirebaseAuthInternal),
140141
ComponentType.PRIVATE
141142
);
142143

143-
(app as unknown as _FirebaseApp)._addComponent(mockAuthComponent,/* overwrite */ true);
144+
((app as unknown) as _FirebaseApp)._addComponent(
145+
mockAuthComponent,
146+
/* overwrite */ true
147+
);
144148
}
145149
if (databaseName) {
146150
// Toggle network connectivity to force a reauthentication attempt.

packages/testing/test/database.test.ts

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ before(() => {
2727
chai.use(chaiAsPromised);
2828
});
2929

30-
describe('Testing Module Tests', function () {
31-
it('assertSucceeds() iff success', async function () {
30+
describe('Testing Module Tests', function() {
31+
it('assertSucceeds() iff success', async function() {
3232
const success = Promise.resolve('success');
3333
const failure = Promise.reject('failure');
3434
await firebase.assertSucceeds(success).catch(() => {
@@ -39,43 +39,45 @@ describe('Testing Module Tests', function () {
3939
.then(() => {
4040
throw new Error('Expected failure to fail.');
4141
})
42-
.catch(() => { });
42+
.catch(() => {});
4343
});
4444

45-
it('assertFails() iff failure', async function () {
45+
it('assertFails() iff failure', async function() {
4646
const success = Promise.resolve('success');
4747
const failure = Promise.reject('failure');
4848
await firebase
4949
.assertFails(success)
5050
.then(() => {
5151
throw new Error('Expected success to fail.');
5252
})
53-
.catch(() => { });
53+
.catch(() => {});
5454
await firebase.assertFails(failure).catch(() => {
5555
throw new Error('Expected failure to succeed.');
5656
});
5757
});
5858

59-
it('initializeTestApp() with auth=null does not set access token', async function () {
59+
it('initializeTestApp() with auth=null does not set access token', async function() {
6060
const app = firebase.initializeTestApp({
6161
projectId: 'foo',
6262
auth: undefined
6363
});
6464

65-
const authInternal = (app as unknown as _FirebaseApp)
66-
.container.getProvider('auth-internal').getImmediate({ optional: true });
67-
// Auth instance will not be available because no API Key is provided
65+
const authInternal = ((app as unknown) as _FirebaseApp).container
66+
.getProvider('auth-internal')
67+
.getImmediate({ optional: true });
68+
// Auth instance will not be available because no API Key is provided
6869
expect(authInternal).to.be.null;
6970
});
7071

71-
it('initializeTestApp() with auth sets the correct access token', async function () {
72+
it('initializeTestApp() with auth sets the correct access token', async function() {
7273
const auth = { uid: 'alice' };
7374
const app = firebase.initializeTestApp({
7475
projectId: 'foo',
7576
auth: auth
7677
});
77-
const authInternal = (app as unknown as _FirebaseApp)
78-
.container.getProvider('auth-internal').getImmediate();
78+
const authInternal = ((app as unknown) as _FirebaseApp).container
79+
.getProvider('auth-internal')
80+
.getImmediate();
7981

8082
const token = await authInternal.getToken();
8183
expect(token).to.have.keys('accessToken');
@@ -86,17 +88,18 @@ describe('Testing Module Tests', function () {
8688
expect(claims).to.deep.equal({ uid: auth.uid, iat: 0, sub: auth.uid });
8789
});
8890

89-
it('initializeAdminApp() sets the access token to "owner"', async function () {
91+
it('initializeAdminApp() sets the access token to "owner"', async function() {
9092
const app = firebase.initializeAdminApp({ projectId: 'foo' });
91-
const authInternal = (app as unknown as _FirebaseApp)
92-
.container.getProvider('auth-internal').getImmediate();
93+
const authInternal = ((app as unknown) as _FirebaseApp).container
94+
.getProvider('auth-internal')
95+
.getImmediate();
9396

9497
const token = await authInternal.getToken();
9598
expect(token).to.have.keys('accessToken');
9699
expect(token!.accessToken).to.be.string('owner');
97100
});
98101

99-
it('loadDatabaseRules() throws if no databaseName or rules', async function () {
102+
it('loadDatabaseRules() throws if no databaseName or rules', async function() {
100103
// eslint-disable-next-line @typescript-eslint/no-explicit-any
101104
await expect((firebase as any).loadDatabaseRules.bind(null, {})).to.throw(
102105
/databaseName not specified/
@@ -113,13 +116,13 @@ describe('Testing Module Tests', function () {
113116
).to.throw(/databaseName not specified/);
114117
});
115118

116-
it('loadDatabaseRules() tries to make a network request', async function () {
119+
it('loadDatabaseRules() tries to make a network request', async function() {
117120
await expect(
118121
firebase.loadDatabaseRules({ databaseName: 'foo', rules: '{}' })
119122
).to.be.rejectedWith(/ECONNREFUSED/);
120123
});
121124

122-
it('loadFirestoreRules() succeeds on valid input', async function () {
125+
it('loadFirestoreRules() succeeds on valid input', async function() {
123126
let promise = firebase.loadFirestoreRules({
124127
projectId: 'foo',
125128
rules: `service cloud.firestore {
@@ -131,28 +134,28 @@ describe('Testing Module Tests', function () {
131134
await expect(promise).to.be.rejectedWith(/UNAVAILABLE/);
132135
});
133136

134-
it('clearFirestoreData() succeeds on valid input', async function () {
137+
it('clearFirestoreData() succeeds on valid input', async function() {
135138
let promise = firebase.clearFirestoreData({
136139
projectId: 'foo'
137140
});
138141
await expect(promise).to.be.rejectedWith(/UNAVAILABLE/);
139142
});
140143

141-
it('apps() returns apps created with initializeTestApp', async function () {
144+
it('apps() returns apps created with initializeTestApp', async function() {
142145
const numApps = firebase.apps().length;
143146
await firebase.initializeTestApp({ databaseName: 'foo', auth: undefined });
144147
expect(firebase.apps().length).to.equal(numApps + 1);
145148
await firebase.initializeTestApp({ databaseName: 'bar', auth: undefined });
146149
expect(firebase.apps().length).to.equal(numApps + 2);
147150
});
148151

149-
it('there is a way to get database timestamps', function () {
152+
it('there is a way to get database timestamps', function() {
150153
expect(firebase.database.ServerValue.TIMESTAMP).to.deep.equal({
151154
'.sv': 'timestamp'
152155
});
153156
});
154157

155-
it('there is a way to get firestore timestamps', function () {
158+
it('there is a way to get firestore timestamps', function() {
156159
expect(firebase.firestore.FieldValue.serverTimestamp()).not.to.be.null;
157160
});
158161
});

0 commit comments

Comments
 (0)