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
Improve building api by first checking if api/prisma/
exists
#595
Improve building api by first checking if api/prisma/
exists
#595
Conversation
@peterp I've added the "does prisma.schema exist?" check directly to I'm not sure if this is an improvement or not. It makes more logical sense, but I'm also now wondering if I've created some other downstream effects... thoughts?
|
confirmed working on Windows including support for space in path
@RobertBroersma I could use Jest guidance here if you have some time. (Beware, I'm a n00b.) I've added some file-check logic to
The current test is pretty basic, it confirms the Listr Task output. But of course the file check now always fails, so the test fails. Ideally, my test will check for both cases where the file either does or does not exist. I think the best place to test the function in L13 is actually in
Recommendations for approach and Jest tools to use? And, in either case, could you point me to a Jest example I could reference? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙌ship it!
@thedavidprice I'm thinking mocking out There's an example for how to do that here, with a nice addition of being able to set which files your fake file system would contain: https://jestjs.io/docs/en/manual-mocks#examples A manual mock file like that would mock I don't know what issues with Windows support you are referring to, but I'd say we should be able to rely on Hope that helps! |
If an App does not include
api/prisma/
, thenyarn rw build
throws an error.This adds a simple check to determine whether to generate the Prisma Client based on whether
prisma/
exists.