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

Refactor project to ESM #128

Merged
merged 9 commits into from
Oct 9, 2022
Merged

Refactor project to ESM #128

merged 9 commits into from
Oct 9, 2022

Conversation

zaldih
Copy link
Member

@zaldih zaldih commented Oct 1, 2022

While I was updating the dependencies, I realized that today many modules are migrating to ESM, so it was impossible to keep some of them to the latest version.

const readFileSyncSpy = jest.spyOn(fs, 'readFileSync').mockImplementation();
// const readFileSyncSpy = jest.spyOn(fs, 'readFileSync').mockImplementation();
const readFileSyncSpy = jest.fn();
jest.unstable_mockModule('fs', () => ({ readFileSync: readFileSyncSpy }));
Copy link
Member Author

Choose a reason for hiding this comment

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

This mock does not work. When executing the test, it throws the error: "ENOENT: no such file or directory, open 'file.json'"

@zaldih zaldih requested a review from Caballerog October 8, 2022 18:04
@zaldih zaldih merged commit 0e0d336 into develop Oct 9, 2022
@zaldih zaldih deleted the refactor/esm branch October 9, 2022 11:54
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.

None yet

2 participants