-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added firebaseStorageContextFactory
- Loading branch information
Showing
20 changed files
with
206 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
import { describeFirestoreQueryDriverTests, describeFirestoreAccessorDriverTests } from '@dereekb/firebase/test'; | ||
import { adminTestWithMockItemCollection } from '@dereekb/firebase-server/test'; | ||
import { dbxComponentsAdminTestWithMockItemCollection } from '@dereekb/firebase-server/test'; | ||
|
||
jest.setTimeout(9000); | ||
|
||
describe('firestore server', () => { | ||
adminTestWithMockItemCollection((f) => { | ||
dbxComponentsAdminTestWithMockItemCollection((f) => { | ||
describeFirestoreAccessorDriverTests(f); | ||
}); | ||
|
||
adminTestWithMockItemCollection((f) => { | ||
dbxComponentsAdminTestWithMockItemCollection((f) => { | ||
describeFirestoreQueryDriverTests(f); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
packages/firebase-server/src/lib/firestore/test.document.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
packages/firebase-server/src/lib/firestore/test.iterator.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import { describeFirestoreIterationTests } from '@dereekb/firebase/test'; | ||
import { adminTestWithMockItemCollection } from '@dereekb/firebase-server/test'; | ||
import { dbxComponentsAdminTestWithMockItemCollection } from '@dereekb/firebase-server/test'; | ||
|
||
adminTestWithMockItemCollection((f) => { | ||
dbxComponentsAdminTestWithMockItemCollection((f) => { | ||
describeFirestoreIterationTests(f); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { authorizedTestWithMockItemStorage, describeFirebaseStorageAccessorDriverTests } from '@dereekb/firebase/test'; | ||
import { dbxComponentsAdminTestWithMockItemCollection } from '@dereekb/firebase-server/test'; | ||
|
||
describe('firebase storage server', () => { | ||
authorizedTestWithMockItemStorage((f) => { | ||
describeFirebaseStorageAccessorDriverTests(f); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 0 additions & 9 deletions
9
packages/firebase-server/test/src/lib/firestore/firestore.fixture.admin.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
// export * from './firestore.admin'; // not exported. Only for the firebase-server since we defined the config in there. | ||
export * from './firestore.fixture.admin'; | ||
export * from './firestore.admin'; | ||
export * from './firestore'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export * from './storage'; | ||
export * from './storage.admin'; |
22 changes: 22 additions & 0 deletions
22
packages/firebase-server/test/src/lib/storage/storage.admin.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { testWithMockItemStorageFixture } from '@dereekb/firebase/test'; | ||
import { JestTestContextFactory } from '@dereekb/util/test'; | ||
import { GoogleCloudTestFirebaseStorageContextFixture, googleCloudTestFirebaseStorageBuilder } from './storage'; | ||
|
||
export type GoogleFirebaseStorageTestContextFactory = JestTestContextFactory<GoogleCloudTestFirebaseStorageContextFixture>; | ||
|
||
/** | ||
* Default firestore admin factory. | ||
* | ||
* Host of localhost, port 9906 | ||
*/ | ||
export const adminFirebaseStorageFactory: GoogleFirebaseStorageTestContextFactory = googleCloudTestFirebaseStorageBuilder({ | ||
host: 'localhost', | ||
port: 9906 | ||
}); | ||
|
||
/** | ||
* Convenience mock instance for tests within an authorized context. | ||
* | ||
* Uses @google-cloud/firestore | ||
*/ | ||
export const dbxComponentsAdminTestWithMockItemStorage = testWithMockItemStorageFixture()(adminFirebaseStorageFactory); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.