feat(mocha-to-node-test-runner): migrate mocha@8.x to node:test (v22, v24+)#313
feat(mocha-to-node-test-runner): migrate mocha@8.x to node:test (v22, v24+)#313Xstoudi wants to merge 23 commits intonodejs:mainfrom
node:test (v22, v24+)#313Conversation
AugustinMauroy
left a comment
There was a problem hiding this comment.
Oh nice that really cool !
Few points that can be improved:
- md format on readme
- little bit of JSdoc
- small missing unit test
Co-authored-by: Augustin Mauroy <97875033+AugustinMauroy@users.noreply.github.com>
|
I wrote test for is-esm, let me know if you see something is missing. I applied your recommendations then reverted two of them:
Let me now if there is anything else. |
| it('should return -1 when the value is not present', function() { | ||
| const arr = [1, 2, 3]; | ||
| assert.strictEqual(arr.indexOf(4), -1); | ||
| }); |
There was a problem hiding this comment.
maybe add an other it that use arrow function as call back
and a fonction as arg like
function myBasicTest = () => {
assert(true)
}The second case will be can super complicated to migrate.
in a first time let's just have test that proof that's ins't handled and document it.
In second time (follow up pr) having systems that handle this case. The logic to catch a refercen is already furnished by the codemod context https://docs.codemod.com/jssg/semantic-analysis
|
Let me know if anything more is required. |
AugustinMauroy
left a comment
There was a problem hiding this comment.
LGMT ! for the code transformation part missing the removing dep you should take code from chalk-to-styletext.
|
Added that, let me know if something is missing. |
AugustinMauroy
left a comment
There was a problem hiding this comment.
For me it's good ! we need to wait a second approval to land !
|
F*ck what happened here. !Windows! cc @nodejs/userland-migrations any idea |
|
hey 👋 @Xstoudi |
Co-authored-by: Bruno Rodrigues <swe@brunocroh.com>
AugustinMauroy
left a comment
There was a problem hiding this comment.
LGTM ! I stil don't get why windows give this error
Maybe use lower comparison level on testing https://docs.codemod.com/jssg/testing#strictness-levels
|
The windows testing is failing with: Where it looks like the entire contents of the expected file isn't there. @mohebifar have you seen anything like this before? |
node:test (v22, v24+)
node:test (v22, v24+)node:test (v22, v24+)
node:test (v22, v24+)node:test (v22, v24+)
JakobJingleheimer
left a comment
There was a problem hiding this comment.
Thanks for this! 🙌
A few nits here and there.
For the test files, could the names please be more descriptive (eg 3_hooks is not so illuminating).
Also, there are 2 options for organising test files. We do have a bit of a mix, but option 1 is far superior to the "junk-drawer" option 2. Would you mind adjusting these to option 1? If you don't want to bother with it, that's fine—but would you mind if one of us made the adjustment within this PR?
I haven't reviewed the test cases yet because it's so cumbersome with option 2.
Windows didn't encode tab like unix and I assume the test file was written with unix like OS |
Co-authored-by: Jacob Smith <3012099+JakobJingleheimer@users.noreply.github.com>
Should fix #103