Skip to content
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

Merged
merged 16 commits into from
Feb 15, 2024
Merged

test: add tests for utils #33

merged 16 commits into from
Feb 15, 2024

Conversation

dristpunk
Copy link
Contributor

🤖 Linear

Closes BES-267

@dristpunk dristpunk requested a review from gas1cent February 12, 2024 10:25
@dristpunk dristpunk self-assigned this Feb 12, 2024
Copy link

linear bot commented Feb 12, 2024

@gas1cent gas1cent added this to the v1.1.0 milestone Feb 13, 2024
@dristpunk dristpunk marked this pull request as ready for review February 13, 2024 14:12
@dristpunk
Copy link
Contributor Author

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'));
Copy link
Member

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?

Copy link
Contributor Author

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

src/utils.ts Show resolved Hide resolved
test/parser.test.ts Outdated Show resolved Hide resolved
test/processor.test.ts Outdated Show resolved Hide resolved
test/processor.test.ts Show resolved Hide resolved
test/utils.test.ts Outdated Show resolved Hide resolved
test/utils.test.ts Outdated Show resolved Hide resolved
test/utils.test.ts Outdated Show resolved Hide resolved
test/utils/mocks.ts Outdated Show resolved Hide resolved
test/validator.test.ts Outdated Show resolved Hide resolved
Copy link

@excaliborr excaliborr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@gas1cent gas1cent merged commit 050f258 into main Feb 15, 2024
4 checks passed
@gas1cent gas1cent deleted the test/missing-tests branch February 15, 2024 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants