@@ -138,6 +138,44 @@ describe('Database@exp Tests', () => {
138138 unsubscribe ( ) ;
139139 } ) ;
140140
141+ /*it('can connected to emulator', async () => {
142+ if (isEmulatorActive()) {
143+ const db = getDatabase(defaultApp);
144+ connectDatabaseEmulator(db, 'localhost', parseInt(EMULATOR_PORT, 10));
145+ await get(refFromURL(db, `${DATABASE_ADDRESS}/foo/bar`));
146+ }
147+ });
148+ it('can chnage emulator config before network operations', async () => {
149+ if (isEmulatorActive()) {
150+ const db = getDatabase(defaultApp);
151+ const port = parseInt(EMULATOR_PORT, 10);
152+ connectDatabaseEmulator(db, 'localhost', port + 1);
153+ connectDatabaseEmulator(db, 'localhost', port);
154+ await get(refFromURL(db, `${DATABASE_ADDRESS}/foo/bar`));
155+ }
156+ });
157+ it('can connected to emulator after network operations with same parameters', async () => {
158+ if (isEmulatorActive()) {
159+ const db = getDatabase(defaultApp);
160+ const port = parseInt(EMULATOR_PORT, 10);
161+ connectDatabaseEmulator(db, 'localhost', port);
162+ await get(refFromURL(db, `${DATABASE_ADDRESS}/foo/bar`));
163+ connectDatabaseEmulator(db, 'localhost', port);
164+ }
165+ });
166+ it('cannot connect to emulator after network operations with different parameters', async () => {
167+ if (isEmulatorActive()) {
168+ const db = getDatabase(defaultApp);
169+ const port = parseInt(EMULATOR_PORT, 10);
170+ connectDatabaseEmulator(db, 'localhost', port);
171+ await get(refFromURL(db, `${DATABASE_ADDRESS}/foo/bar`));
172+ expect(() => {
173+ connectDatabaseEmulator(db, 'localhost', 9001);
174+ }).to.throw();
175+ }
176+ });
177+ */
178+
141179 it ( 'can properly handle unknown deep merges' , async ( ) => {
142180 // Note: This test requires `testIndex` to be added as an index.
143181 // Please run `yarn test:setup` to ensure that this gets added.
0 commit comments