Skip to content

feat(tape-to-node-test): introduce - #296

Open
AugustinMauroy wants to merge 34 commits into
mainfrom
tape-to-node-test
Open

feat(tape-to-node-test): introduce #296
AugustinMauroy wants to merge 34 commits into
mainfrom
tape-to-node-test

Conversation

@AugustinMauroy

@AugustinMauroy AugustinMauroy commented Dec 10, 2025

Copy link
Copy Markdown
Member

Related issue

Close #260

@AugustinMauroy
AugustinMauroy marked this pull request as ready for review December 15, 2025 19:28
@AugustinMauroy
AugustinMauroy requested review from a team and ljharb December 15, 2025 19:28
@AugustinMauroy AugustinMauroy added the awaiting reviewer Author has responded and needs action from the reviewer label Dec 15, 2025
Comment thread recipes/tape-to-node-test/src/workflow.ts Outdated
Comment thread recipes/tape-to-node-test/src/workflow.ts
Comment thread recipes/tape-to-node-test/src/workflow.ts Outdated
Comment thread recipes/tape-to-node-test/src/workflow.ts
AugustinMauroy and others added 2 commits December 18, 2025 22:35
Co-authored-by: Bruno Rodrigues <swe@brunocroh.com>
Comment thread recipes/tape-to-node-test/src/workflow.ts

@ljharb ljharb left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(btw the diff would read cleaner if it was "output" instead of "expected", because then "input" would be sorted before "output" instead of the reverse)

some of my comments apply on all the input/expected combos, so i'll post this now before being exhaustive

Comment thread recipes/tape-to-node-test/tests/new-features/expected.js
Comment thread recipes/tape-to-node-test/tests/no-callback-args/expected.js Outdated
Comment thread recipes/tape-to-node-test/tests/require-import/expected.js Outdated
@brunocroh brunocroh added awaiting author Reviewer has requested something from the author and removed awaiting reviewer Author has responded and needs action from the reviewer labels Jan 9, 2026
@AugustinMauroy

Copy link
Copy Markdown
Member Author

(btw the diff would read cleaner if it was "output" instead of "expected", because then "input" would be sorted before "output" instead of the reverse)

some of my comments apply on all the input/expected combos, so i'll post this now before being exhaustive

the input/expect structure isn't chose by us it's the design of the codemod tool

@AugustinMauroy

Copy link
Copy Markdown
Member Author

that's fine, but can the PR be marked draft in the meantime? a green PR is mergeable, and with this todo i don't think that's accurate.

i have updated the comment but the user have to found a way to change their code because I dunno if we have an equivalent

@ljharb

ljharb commented Jan 27, 2026

Copy link
Copy Markdown
Member

If there's no equivalent, then probably it doesn't make sense to provide a codemod until there is?

@AugustinMauroy

Copy link
Copy Markdown
Member Author

If there's no equivalent, then probably it doesn't make sense to provide a codemod until there is?

IMO we should warn it on readme and people will be aware and then they know that will change how does it work.
cc @JakobJingleheimer what do you think ?

Comment thread recipes/tape-to-node-test/src/workflow.ts Outdated
Comment on lines +290 to +292
console.warn(
`[Codemod] Warning: ${methodName} at ${fileName}:${line}:${column} has no direct equivalent in node:test. Please migrate manually.`,
);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @nodejs/test_runner a onFailure (perhaps afterFail, keeping the naming similar) handler is a pretty neat feature for us to include.

Also, onFinish -> after, right?, or does after not run on the completion of the test it's created in?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aviv can I invite you to open an issue on test runner repo

Comment thread recipes/tape-to-node-test/src/workflow.ts Outdated
Comment thread recipes/tape-to-node-test/src/workflow.ts
Comment thread recipes/tape-to-node-test/src/workflow.ts
Comment thread recipes/tape-to-node-test/src/workflow.ts Outdated
Comment thread recipes/tape-to-node-test/src/workflow.ts Outdated
Comment thread recipes/tape-to-node-test/src/workflow.ts Outdated
@AugustinMauroy AugustinMauroy changed the title feat(tape-to-node-test): first draft feat(tape-to-node-test): introduce Mar 20, 2026
@AugustinMauroy AugustinMauroy added awaiting author Reviewer has requested something from the author and removed awaiting reviewer Author has responded and needs action from the reviewer labels Mar 20, 2026
AugustinMauroy and others added 3 commits April 6, 2026 10:28
Co-Authored-By: Aviv Keller <me@aviv.sh>
Co-Authored-By: Aviv Keller <me@aviv.sh>
@AugustinMauroy AugustinMauroy added awaiting reviewer Author has responded and needs action from the reviewer and removed awaiting author Reviewer has requested something from the author labels Apr 9, 2026
@brunocroh
brunocroh self-requested a review April 24, 2026 20:51
Comment thread recipes/tape-to-node-test/src/workflow.ts
Comment thread recipes/tape-to-node-test/tests/test-options/input.js
Comment thread recipes/tape-to-node-test/tests/test-options/expected.js
Comment thread recipes/tape-to-node-test/src/workflow.ts
AugustinMauroy and others added 3 commits April 25, 2026 19:54
Co-Authored-By: Bruno Rodrigues <swe@brunocroh.com>

@avivkeller avivkeller left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After rebase LGTM

@ljharb

ljharb commented Aug 6, 2026

Copy link
Copy Markdown
Member

fwiw i still don't think this is a responsible codemod to exist unless it can cover 100% of the features of the thing it's codemodding away from.

@mcollina

mcollina commented Aug 6, 2026

Copy link
Copy Markdown
Member

I concur with @ljharb

The reasons why one uses tape are the opposite of why one would use node:test. Both totally valid.

@AugustinMauroy

AugustinMauroy commented Aug 6, 2026

Copy link
Copy Markdown
Member Author

agree with you. node:test ins't a replacement like tape is dangerous or slow or iDK.
But this is usefull for people who just wanna to have small unit test for their js function. Since it's help you to remove on dep it's also reduce the impact surface.

let's take an example, if you have a small js package that have typescript, tsx, tape as dep. just with one codemod you can remove one dep. and with nodejs/correct-ts-specifiers you maybe able to remove tsx from your dep

So imo we can land this but improve the docs about "Why and when you should use it "

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting reviewer Author has responded and needs action from the reviewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

spec: tape-to-node-test-runner

6 participants