Skip to content

Commit cc79543

Browse files
committed
[AUTOMATED]: Prettier Code Styling
1 parent 1cb9cc2 commit cc79543

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/
@@ -111,13 +114,13 @@ describe('Testing Module Tests', function () {
111114
).to.throw(/databaseName not specified/);
112115
});
113116

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

120-
it('loadFirestoreRules() succeeds on valid input', async function () {
123+
it('loadFirestoreRules() succeeds on valid input', async function() {
121124
let promise = firebase.loadFirestoreRules({
122125
projectId: 'foo',
123126
rules: `service cloud.firestore {
@@ -129,28 +132,28 @@ describe('Testing Module Tests', function () {
129132
await expect(promise).to.be.rejectedWith(/UNAVAILABLE/);
130133
});
131134

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

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

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

153-
it('there is a way to get firestore timestamps', function () {
156+
it('there is a way to get firestore timestamps', function() {
154157
expect(firebase.firestore.FieldValue.serverTimestamp()).not.to.be.null;
155158
});
156159
});

0 commit comments

Comments
 (0)