Skip to content

Cannot read property replace of undefined when path is '/' #97

Closed
@SidneyNemzer

Description

const firebaseMock = require("firebase-mock")

const mockdatabase = new firebaseMock.MockFirebase()
mockdatabase.child('/') //=> TypeError

Runkit

Stacktrace:

TypeError "Cannot read property 'replace' of undefined"
  at Object.mergePaths (node_modules/firebase-mock/src/utils.js:12:46)
  at MockFirebase.child (node_modules/firebase-mock/src/firebase.js:154:36)

Firebase JS SDK behavior:

firebase.database().ref('/') //=> Reference
firebase.database().ref('/').child('/') //=> Reference

(Both reference the same path, "/")

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions