You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The documentation of assertSucceeds and assertFails are "Assert the promise to be rejected with a "permission denied" error", are success and failure the same thing?
* Assert the promise to be rejected with a "permission denied" error.
/** * Assert the promise to be rejected with a "permission denied" error. * * Useful to assert a certain request to be denied by Security Rules. See example below. * This function recognizes permission-denied errors from Database, Firestore, and Storage JS SDKs. * * @param pr - the promise to be asserted * @returns a Promise that is fulfilled if pr is rejected with "permission denied". If pr is * rejected with any other error or resolved, the returned promise rejects. * @public * @example * ```javascript * const unauthed = testEnv.unauthenticatedContext(); * await assertFails(get(doc(unauthed.firestore(), '/private/doc'), { ... }); * ``` */exportfunctionassertFails(pr: Promise<any>): Promise<any>{
/** * Assert the promise to be rejected with a "permission denied" error. * * This is a no-op function returning the passed promise as-is, but can be used for documentational * purposes in test code to emphasize that a certain request should succeed (e.g. allowed by rules). * * @public * @example * ```javascript * const alice = testEnv.authenticatedContext('alice'); * await assertSucceeds(get(doc(alice.firestore(), '/doc/readable/by/alice'), { ... }); * ``` */exportfunctionassertSucceeds<T>(pr: Promise<T>): Promise<T>{
The text was updated successfully, but these errors were encountered:
The documentation of assertSucceeds and assertFails are "Assert the promise to be rejected with a "permission denied" error", are success and failure the same thing?
firebase-js-sdk/packages/rules-unit-testing/src/util.ts
Line 165 in 5a9a144
The text was updated successfully, but these errors were encountered: