export function makeDataSnapshot()

in src/providers/database.ts [29:52]


export function makeDataSnapshot(
  /** Value of data for the snapshot. */
  val: string | number | boolean | any[] | object | null,
  /** Full path of the reference (e.g. 'users/alovelace'). */
  refPath: string,
  /** The Firebase app that the database belongs to.
   * The databaseURL supplied when initializing the app will be used for creating this snapshot.
   * You do not need to supply this parameter if you supplied Firebase config values when initializing
   * firebase-functions-test.
   */
  firebaseApp?: app.App,
  /**
   * The RTDB instance to use when creating snapshot. This will override the `firebaseApp` parameter.
   * If omitted the default RTDB instance is used.
   */
  instance?: string
): database.DataSnapshot {
  return new database.DataSnapshot(
    val,
    refPath,
    firebaseApp || testApp().getApp(),
    instance
  );
}