-
Notifications
You must be signed in to change notification settings - Fork 10
Creating a duplicate database object for the same connection #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I'm facing the same . Is there anyway to fix it ? |
const db = pgp(connection); |
I'm facing the same issue too. In my const postgres = require('cypress-postgres');
module.exports = (on, config) => {
on('task', {
dbQuery: query => postgres(query.query, query.connection),
});
} When I run tests using the task
|
hey man! did u manage to solve it? Im facing this issue right now |
Sorry, I didn't manage to fix it... Please let me know if you find a working solution 😄 |
Yes i did.. have forked ur proj and raised a PR too
…On Mon, 1 Nov 2021, 9:53 pm Klas Idar Langø-Larsen, < ***@***.***> wrote:
I'm facing the same issue too.
In my plugins/index.js file I have
const postgres = require('cypress-postgres');
module.exports = (on, config) => {
on('task', {
dbQuery: query => postgres(query.query, query.connection),
});
}
When I run tests using the task dbQuery I get this in terminal:
WARNING: Creating a duplicate database object for the same connection.
at module.exports (/Users/<username>/<path>/node_modules/cypress-postgres/cypress/plugins/index.js:21:14)
at dbQuery (/Users/<username>/<path>/tests/cypress/plugins/index.js:39:27)
at invoke (/Users/<username>/Library/Caches/Cypress/6.9.1/Cypress.app/Contents/Resources/app/packages/server/lib/plugins/child/task.js:47:14)
hey man! did u manage to solve it? Im facing this issue right now
Sorry, I didn't manage to fix it... Please let me know if you find a
working solution 😄
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AG6RBZZNZHTLNV6YDETSTW3UJZWR3ANCNFSM4ROWCPFQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
I tried this one, and it works perfect. No warnings or errors. U can use pg-promise directly rather than cypress-postgres, because if u check source code of cypress-posgtres it also uses pg-promise under the hood |
Thanks @nurbashanghai - worked like a charm! 🚀 🥳 |
After repeatedly running a test with a call to
cy.task("dbQuery"...
I get warnings:Is it to do with the way dbQuery task is added in plugins? Any advice?
The text was updated successfully, but these errors were encountered: