-
Notifications
You must be signed in to change notification settings - Fork 8
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
test: add tests for utils #33
Conversation
idk why locally the tests worked, there was a certain mistake in contract paths |
@@ -43,11 +38,11 @@ export function isFileInDirectory(directory: string, filePath: string): boolean | |||
export async function getRemappings(rootPath: string): Promise<string[]> { | |||
// First try the remappings.txt file | |||
try { | |||
return await getRemappingsFromFile(path.join(rootPath, 'remappings.txt')); | |||
return await exports.getRemappingsFromFile(path.join(rootPath, 'remappings.txt')); |
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.
What does the exports
achieve?
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.
What does the
exports
achieve?
It makes the mocks possible in tests. I know that a change source code for tests is a bad practice, but the other ways to use mocks in that case are pretty dirty: https://medium.com/welldone-software/jest-how-to-mock-a-function-call-inside-a-module-21c05c57a39f
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.
lgtm!
🤖 Linear
Closes BES-267