-
-
Notifications
You must be signed in to change notification settings - Fork 37
fix: normalize prisma client output paths for consistent import handling #146
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
fix: normalize prisma client output paths for consistent import handling #146
Conversation
Signed-off-by: Silvan Kohler <[email protected]>
|
Thanks! Regarding tests, you could extract the whole path manipulation to a dedicated function, and test it with the various code paths it takes. To get CI to pass, feel free to steal this line from PR https://github.com/47ng/prisma-field-encryption/pull/144/files#diff-b803fcb7f17ed9235f1e5cb1fcd2f5d3b2838429d4368ae4c57ce4436577f03fL27 |
…nction Signed-off-by: Silvan Kohler <[email protected]>
Signed-off-by: Silvan Kohler <[email protected]>
Signed-off-by: Silvan Kohler <[email protected]>
|
The code has been moved into a separate file and wrapped in a function, so it can be tested in isolation. |
commit: |
|
The test is good, but it doesn't run, we need to modify the Jest config file to allow running nested tests (not just at the root of src):
Feel free to use the pkg.pr.new link above to install a preview build in your app to see how it works on your end. |
Signed-off-by: GitHub <[email protected]>
|
I updated the |
|
I tested it on Windows 11 and it has fixed the issue. Before: With https://pkg.pr.new/prisma-field-encryption@146: |
|
Thank you! I'll see if I can deploy this over the weekend. |
Fixes #140
I implemented normalization of the prisma client output path before checking the ending against
'node_modules/@prisma/client'.I am unsure how to go about creating the unit test, because it should mock the
prismaClient.output?.valuebeing in windows path style and running theonGeneratefunction.Any ideas how to implement this unit test?