You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As the Node.js community moves toward ESM, I am looking to switch the project from CommonJS to ECMAScript Modules (ESM). This change is essential to take advantage of ESM's improved support for static analysis, tree shaking, and more reliable code structuring.
The text was updated successfully, but these errors were encountered:
haricnugraha
added
the
Tech Debt
Techdebt need to be implemented the sooner the better, as its getting expensive if implemented later
label
Jan 8, 2024
I've tried to convert the code to ESM. I've successfully converted it, able to run it. But I can't run the test. You can see the code here. I suspect there is a problem with Mocha. I got the following error.
I have tried fixing the failed unit test. Now the test can run normally. It is caused by stub/spy using sinon. Detailed explanation can be read here.
But, after using methods on that blog, another problem arise and i am stuck. I cannot stub/spy 3rd party library. It always return error undefined like this
So for now, i temporarily exclude 9 files that test module with 3rd party library. The list is on this file .mocharc.json. All code changes can be seen here
As the Node.js community moves toward ESM, I am looking to switch the project from CommonJS to ECMAScript Modules (ESM). This change is essential to take advantage of ESM's improved support for static analysis, tree shaking, and more reliable code structuring.
Read more:
The text was updated successfully, but these errors were encountered: