-
Notifications
You must be signed in to change notification settings - Fork 39
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
Switch from esmock to node.js mock tracker #446
base: master
Are you sure you want to change the base?
Switch from esmock to node.js mock tracker #446
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also make sure tests pass locally
@@ -70,8 +70,6 @@ | |||
"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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
].join("\n") | |
); | |
].join("\n")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in latest commit
converted all tests that uses esmock to Node.js MockTracker