|
17 | 17 | import * as admin from '../../lib/index'; |
18 | 18 | import * as chai from 'chai'; |
19 | 19 | import * as chaiAsPromised from 'chai-as-promised'; |
20 | | -import { defaultApp, nullApp, nonNullApp, cmdArgs, databaseUrl } from './setup'; |
| 20 | +import { defaultApp, nullApp, nonNullApp, cmdArgs, databaseUrl, isEmulator } from './setup'; |
21 | 21 |
|
22 | 22 | // eslint-disable-next-line @typescript-eslint/no-var-requires |
23 | 23 | const chalk = require('chalk'); |
@@ -64,7 +64,13 @@ describe('admin.database', () => { |
64 | 64 | .should.eventually.be.fulfilled; |
65 | 65 | }); |
66 | 66 |
|
67 | | - it('App with null auth overrides is blocked by security rules', () => { |
| 67 | + it('App with null auth overrides is blocked by security rules', function () { |
| 68 | + if (isEmulator) { |
| 69 | + // RTDB emulator has open security rules by default and won't block this. |
| 70 | + // TODO(https://github.com/firebase/firebase-admin-node/issues/1149): |
| 71 | + // remove this once updating security rules through admin is in place. |
| 72 | + return this.skip(); |
| 73 | + } |
68 | 74 | return nullApp.database().ref('blocked').set(admin.database.ServerValue.TIMESTAMP) |
69 | 75 | .should.eventually.be.rejectedWith('PERMISSION_DENIED: Permission denied'); |
70 | 76 | }); |
@@ -157,13 +163,21 @@ describe('admin.database', () => { |
157 | 163 | }); |
158 | 164 | }); |
159 | 165 |
|
160 | | - it('admin.database().getRules() returns currently defined rules as a string', () => { |
| 166 | + it('admin.database().getRules() returns currently defined rules as a string', function () { |
| 167 | + if (isEmulator) { |
| 168 | + // https://github.com/firebase/firebase-admin-node/issues/1149 |
| 169 | + return this.skip(); |
| 170 | + } |
161 | 171 | return admin.database().getRules().then((result) => { |
162 | 172 | return expect(result).to.be.not.empty; |
163 | 173 | }); |
164 | 174 | }); |
165 | 175 |
|
166 | | - it('admin.database().getRulesJSON() returns currently defined rules as an object', () => { |
| 176 | + it('admin.database().getRulesJSON() returns currently defined rules as an object', function () { |
| 177 | + if (isEmulator) { |
| 178 | + // https://github.com/firebase/firebase-admin-node/issues/1149 |
| 179 | + return this.skip(); |
| 180 | + } |
167 | 181 | return admin.database().getRulesJSON().then((result) => { |
168 | 182 | return expect(result).to.be.not.undefined; |
169 | 183 | }); |
|
0 commit comments