Switch from esmock to node.js mock tracker#446
Switch from esmock to node.js mock tracker#446albertshay888 wants to merge 12 commits intoNodeSecure:masterfrom albertshay888:Switch-from-esmock-to-Node.js-MockTracker
Conversation
|
Hi @albertshay888, can you remove the tests commented (what you migrated) ? Thanks |
|
Also, you don't need to do dynamic imports after mocking, you can drop these and import what needs to be tested classically at the top of the file. |
…js and added the imports at the top of each file
PierreDemailly
left a comment
There was a problem hiding this comment.
You can also uninstall esmock (npm un esmock) and change the test script from
glob -c \"node --loader=esmock --no-warnings --test-concurrency 1 --test\" \"test/**/*.test.js\"
to
glob -c \"node --test-concurrency 1 --test\" \"test/**/*.test.js\"
Note that there are little conflicts, you can sync your fork and rebase with the main branch
|
Is this ok or can i do it ? |
I guess you can work on it 😄 |
…ck imports and previous commented out tests, removed readFileSyncMock.mock.restoreAll() in the last test for scorecard.test.js file, fixed all async spacing, and removed indexModule and used buildServerimport instead
|
Hi @albertshay888 Can you please rebase and fix conflicts ? |
…s/scorecard.test.js file
|
@albertshay888 You have to sync it (you should have a Sync button on GitHub), then rebase |
|
no longer has conflicts with base branch |
|
Tests KO |
…est.js and httpServer.test.js
PierreDemailly
left a comment
There was a problem hiding this comment.
Also make sure tests pass locally
| "c8": "^10.1.2", | ||
| "cross-env": "^7.0.3", | ||
| "esbuild": "^0.24.0", | ||
| "eslint-plugin-jsdoc": "^50.6.2", |
There was a problem hiding this comment.
This dep is needed for the eslint config, you removed it when resolving conflicts i guess (just reinstall it)
There was a problem hiding this comment.
reinstalled "eslint-plugin-jsdoc": "^50.6.2", in latest commit
test/commands/scorecard.test.js
Outdated
| ].join("\n") | ||
| ); |
There was a problem hiding this comment.
| ].join("\n") | |
| ); | |
| ].join("\n")); |



converted all tests that uses esmock to Node.js MockTracker