Jaye
08/23/2021, 9:20 AM/cypress/plugins/index.js
i have:
const seedDb = require("../../prisma/seed.js")
module.exports = on => {
on("task", {
resetDb: async () => {
await seedDb()
return true
},
})
}
which works fine, but my prisma seed file can't find the database url: 😞
const { PrismaClient } = require("@prisma/client")
const prisma = new PrismaClient()
const main = async () => {
// make stuff here
}
main()
.catch(e => {
console.error(e)
process.exit(1)
})
.finally(async () => {
await prisma.$disconnect()
})
module.exports = main
i'm invoking it using a command like this in my npm scripts, like the docs suggest
"cypress": "dotenv -e .env.test next dev & cypress open",
and i have a .env.test
file defined with a working DATABASE_URL
string.
what am i doing wrong?Ryan
08/23/2021, 10:21 AM