I’m in the process of setting up my pipelines, which makes me go over all the test coverage and really get into the matter of automated tests.
I’m running RW 0.21.0, when doing yarn rw test api
I get a bunch of failed tests on the api side, those are the scaffolded tests.
Here’s what I get in my terminal:
FAIL api api/src/services/products/products.test.ts
● Test suite failed to run
Error: error: Error validating datasource `DS`: The URL for datasource `DS` must start with the protocol `postgresql://`.
--> schema.prisma:5
|
4 | provider = "postgresql"
5 | url = env("DATABASE_URL")
|
Validation Error Count: 1
at LineStream.<anonymous> (../node_modules/@prisma/client/runtime/index.js:27430:31)
at LineStream._pushBuffer (../node_modules/@prisma/client/runtime/index.js:24491:19)
at LineStream._transform (../node_modules/@prisma/client/runtime/index.js:24485:10)
Here’s the usual suspect:
/*
import { products } from './products'
*/
describe('products', () => {
it('returns true', () => {
expect(true).toBe(true)
})
})
Relevant bit of my .env
file:
DATABASE_URL=postgresql://fqbfedhvuwsa[...]
Not sure how to fix this and get my api tests up and working…
Apparently members of the community got these to work so it must be something wrong on my side, any help would be much appreciated.