Skip to content

Commit 0dafdb1

Browse files
committed
Formatting pass
1 parent b32ad7c commit 0dafdb1

File tree

1 file changed

+34
-14
lines changed

1 file changed

+34
-14
lines changed

packages/app/src/indexeddb.test.ts

Lines changed: 34 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,27 @@
1+
/**
2+
* @license
3+
* Copyright 2022 Google LLC
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
118
import { expect } from 'chai';
219
import '../test/setup';
320
import { match, stub } from 'sinon';
4-
import { readHeartbeatsFromIndexedDB, writeHeartbeatsToIndexedDB } from './indexeddb';
21+
import {
22+
readHeartbeatsFromIndexedDB,
23+
writeHeartbeatsToIndexedDB
24+
} from './indexeddb';
525
import { FirebaseApp } from './public-types';
626
import { AppError } from './errors';
727
import { HeartbeatsInIndexedDB } from './types';
@@ -20,15 +40,13 @@ describe('IndexedDB functions', () => {
2040
await readHeartbeatsFromIndexedDB({
2141
name: 'testname',
2242
options: { appId: 'test-app-id' }
23-
} as FirebaseApp
24-
);
43+
} as FirebaseApp);
2544
expect(warnStub).to.be.calledWith(match.any, match(AppError.IDB_GET));
2645
} else {
2746
await readHeartbeatsFromIndexedDB({
2847
name: 'testname',
2948
options: { appId: 'test-app-id' }
30-
} as FirebaseApp
31-
);
49+
} as FirebaseApp);
3250
expect(warnStub).to.be.calledWith(match.any, match(AppError.IDB_GET));
3351
}
3452
});
@@ -37,21 +55,23 @@ describe('IndexedDB functions', () => {
3755
if (typeof window !== 'undefined') {
3856
// Ensure that indexedDB.open() fails in browser. It will always fail in Node.
3957
stub(window.indexedDB, 'open').throws(new Error('abcd'));
40-
await writeHeartbeatsToIndexedDB({
41-
name: 'testname',
42-
options: { appId: 'test-app-id' }
43-
} as FirebaseApp,
58+
await writeHeartbeatsToIndexedDB(
59+
{
60+
name: 'testname',
61+
options: { appId: 'test-app-id' }
62+
} as FirebaseApp,
4463
{} as HeartbeatsInIndexedDB
4564
);
4665
expect(warnStub).to.be.calledWith(match.any, match(AppError.IDB_WRITE));
4766
} else {
48-
await writeHeartbeatsToIndexedDB({
49-
name: 'testname',
50-
options: { appId: 'test-app-id' }
51-
} as FirebaseApp,
67+
await writeHeartbeatsToIndexedDB(
68+
{
69+
name: 'testname',
70+
options: { appId: 'test-app-id' }
71+
} as FirebaseApp,
5272
{} as HeartbeatsInIndexedDB
5373
);
5474
expect(warnStub).to.be.calledWith(match.any, match(AppError.IDB_WRITE));
5575
}
5676
});
57-
});
77+
});

0 commit comments

Comments
 (0)