forked from aadsm/jsmediatags
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trying to resolve the rest of the issues with the ESM rewrite of the Jest tests. Making the mocking procedures ESM-compliant was part of the holdup, at least in terms of that it uses different Jest functions that are specific to ESM, which were different when previously compiling back to CJS as the endpoint. Just to make things a bit easier to debug and understand, I moved the Node FS and XMLHttpRequest mocks into the tests themselves, since it doesn't appear that you can have a custom mocking folder structure, unlike which you can with regular tests. The mocking still isn't fully working, but these resources helped lead me to this point now. https://stackoverflow.com/questions/40465047/how-can-i-mock-an-es6-module-import-using-jest https://remarkablemark.org/blog/2018/06/28/jest-mock-default-named-export/ jestjs/jest#10025 https://github.com/connorjburton/js-ts-jest-esm-mock
- Loading branch information
1 parent
fab1e1a
commit 348fd60
Showing
4 changed files
with
288 additions
and
299 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.