Skip to content

chore: add tests for metadata behavior #2563

Draft
maverick1872 wants to merge 5 commits intowinstonjs:masterfrom
maverick1872:behavior-tests
Draft

chore: add tests for metadata behavior #2563
maverick1872 wants to merge 5 commits intowinstonjs:masterfrom
maverick1872:behavior-tests

Conversation

@maverick1872
Copy link
Copy Markdown
Member

  • chore: introduce tests from issue/2029 #2284
  • chore: update npm scripts
  • chore: remove unused imports
  • chore: update tests and breakout some for child loggers and metadata behavior

assume(expectedOutput).eqls(actualLogOutput);
});

it.skip("should allow overriding the parent's default metadata without affecting the parent", () => {
Copy link
Copy Markdown
Member Author

@maverick1872 maverick1872 Jul 29, 2025

Choose a reason for hiding this comment

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

@DABH Started to go through the process of introducing tests from my other branch, independently of introducing fixes. This is when I remembered we use mocha as a test runner which unfortunately lacks the .failing behavior that's available in jest. This means for the tests that expected to fail due to a functionality gap I'm forced to make them be skipped like this one.

Curious on your thoughts on me opening a PR to replace mocha with jest as the test runner moving forward to enable access to this functionality and everything else provided by it?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I am ok if you want to migrate us from mocha to jest - we’ve been using mocha for only historical purposes afaik, I’ve used jest in other projects. Don’t want to add more work to your plate haha but yeah feel free and thank you 😅

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

(Though perhaps Claude Code etc. can now make things like mocha->jest migration trivial 😅🤖)

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.

It's actually a pretty low-effort migration I believe. If I'm not mistaken it should be just a transition of the test hooks (before/after) to (before[each/all]/after[each/all]). Will throw something together.

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.

Agree with you @DABH that claude will make what were previously long, tedious migrations such as mocha –> jest nearly trivial as these tools continue to mature in the market.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants