Skip to content

Firebase Rules Unit Testing | Error: Not Implemented #7391

@Psycarlo

Description

@Psycarlo

Operating System

Windows 10 Pro

Browser Version

Google Chrome 114.0.5735.134

Firebase SDK Version

^9.17.2

Firebase SDK Product:

Firestore

Describe your project's tooling

Vue SPA with Vite and Vitest

Describe the problem

When running my unit tests with the firebase emulators I get "Error: Not implemented"

beforeAll(async () => {
try {
testEnv = await initializeTestEnvironment({
projectId: MY_PROJ_ID,
storage: { rules: readFileSync('storage.rules', 'utf-8') }
})
} catch (err) {
console.log(err)
}
})

Error: Not Implemented
at loadStorageRules (.../node_modules/@firebase/rules-unit-testing/src/impl/rules.ts:87:11)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at Module.initializeTestEnvironment (.../node_modules/@firebase/rules-unit-testing/src/initialize.ts:102:5)

Steps and code to reproduce issue

Here are the versions:

"firebase": "^9.17.2",
"firebase-tools": "^12.4.0",
"vitest": "^0.32.2",

Script:

"test:unit:ci": "firebase emulators:exec --only auth,firestore,storage --import=./data/test/ "vitest --dir=tests/unit --watch=false"

Identical: https://stackoverflow.com/questions/75441714/why-am-i-getting-a-not-implemented-error-when-unit-testing-firebase-security-r

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions