Comments (8)
You have overriden the plugins file and only register code coverage tasks. You file should read
const admin = require("firebase-admin");
const cypressFirebasePlugin = require("cypress-firebase").plugin;
module.exports = (on, config) => {
cypressFirebasePlugin(on, config, admin);
require('@cypress/code-coverage/task')(on, config)
return config
}
from cypress-firebase.
I struggled trying to get the examples/basic project running. I was getting TypeScript errors within Cypress complaining about extendWithFirebaseConfig not being a function. I wasted too much time on it so I built my own simple app along with reproduction steps:
https://github.com/gregfenton/cypress-firebase-code-coverage
See the README at the root of the project. Should take 5-10 minutes to get the repro going, depending on whether you go with my Firebase project or you create your own.
(If I remember, I'll tear down that serviceAccount in the next few days, so please let me know if/when you have validated the issue (by "you" I mean the wider github audience...this doesn't all have to fall to @prescottprue !)
from cypress-firebase.
@prescottprue - want me to update the README patch accordingly?
from cypress-firebase.
Are you sure you included the plugin? The list of tasks doesn’t seem to include any of the custom cypress-firebase tasks. Can you share the repo so I can be sure to reproduce the issue?
from cypress-firebase.
Thanks for the repro - I'll look into it. I have not kept the examples of this repo as up to date as I should, but instead have mostly been using cypress-firebase in different projects. Glad to have folks like you reminding me to come back and clean up the example/docs - the PRs are much appreciated 😄
from cypress-firebase.
I'm pretty certain this is just going to be a build or runtime config thingy. Somehow we need to convince @cypress/code-coverage and/or nyc to "instrument" callFirestore/callRtdb, or convince them to ignore callFirestore/callRtdb.
My app code is just fine, including all the npms I am using. But cypress-firebase is exposed directly to Cypress, so it isn't going through the same build/startup routines.
from cypress-firebase.
Brilliant, thank you. With the above, I am now running my cypress-firebase tests with code-coverage!!
Wasn't clear to me that the same module.exports was to be used for both code-coverage and other tasks. I'll put up a PR for the code-coverage README to help others in the future.
Thanks @bahmutov and @prescottprue !!!
from cypress-firebase.
Thanks for posting @bahmutov that is right!
If you want the config extending that happens through the plugin as well you can do the following:
const admin = require("firebase-admin");
const cypressFirebasePlugin = require("cypress-firebase").plugin;
module.exports = (on, config) => {
const newConfig = cypressFirebasePlugin(on, config, admin);
require('@cypress/code-coverage/task')(on, config)
return newConfig
}
from cypress-firebase.
Related Issues (20)
- publish-npm failing Error: Error [ERR_REQUIRE_ESM]: require() of ES Module HOT 1
- bug: cannot read properties of undefined (reading 'includes') HOT 4
- Login after a logout happening the application fails
- Cypress e2e test fails initialization HOT 1
- feat(build): native esm support
- fix: drop support for node pre 16 HOT 2
- Support passing user claims to cy.login() ? HOT 1
- Invalid options types are ignored, rather than erroring
- The automated release is failing 🚨
- bug(docs): README.md setup is not clear about service account HOT 6
- Retry on 401
- bug(firestore): FieldValue.delete() not handled correctly HOT 3
- feat(callFirestore): ability to use batch writes
- bug(firestore): nested Timestamp value not persisting HOT 3
- bug: callFirestore not recognized in NextJS test HOT 1
- feat: support for component testing
- feat: switch to modular firebase sdks internally HOT 2
- bug(core): Webpack error when running cypress tests with cypress-firebase HOT 10
- callFirestore task fails when running in the CI with message "PERMISSION_DENIED: Missing or insufficient permissions." HOT 1
- Problem with Token HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cypress-firebase.