-
Notifications
You must be signed in to change notification settings - Fork 34
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
chore(test): Migrate test suites from mocha to node test runner #160
Conversation
Signed-off-by: Kaung Zin Hein <kaungzinhein113@gmail.com>
Signed-off-by: Kaung Zin Hein <kaungzinhein113@gmail.com>
The CI tests are ran on node-version: [14.x, 16.x, 18.x, 20.x, 22.x]. But node test runner was added in v16.17.0. So would support for node 14 be dropped? |
Nice! This is awesome. I think it's fine to finally drop Node 14. It's quite old at this point. |
Interestingly, the tests are not run or only run partially, depending on the node version.
*Tested locally and as observed in CI The test runner doesn't support running |
Good catch! I recently migrated a different library to https://github.com/badgateway/structured-headers/pull/58/files Basically I:
This mostly solved all my problems. |
Oh I see. Will try it! |
Signed-off-by: Kaung Zin Hein <kaungzinhein113@gmail.com>
The tests were passing but the process was hanging. It seems that Currently, the tests in fetch-wrapper.ts will all pass but the process will hang, so the next test file isn't continued. More specifically, the first two tests in that file are causing the hang - verified by attaching (So |
I'd imagine that this is a deliberate choice by Node, to keep things somewhat simple and explicit, but yeah i bet it was annoying to deal with.
I'm almost certain this is because One idea is to explicitly disable this, or call There's definitely more hoops here than I expected, so I understand if you're out of patience. If so I'll definitely build on your work to complete this. Either way I really appreciate the work so far! |
Signed-off-by: Kaung Zin Hein <kaungzinhein113@gmail.com>
Gotcha, I added a fix. Feel free to adjust for any improvement. |
Very frustrating! If I'm reading the errors right, we need tsx 3 for Node =< 16, and tsx 4 for Node > 20 |
Given that dropping older Node versions is already a major change, maybe it's time to also drop Node 16, and make this PR of a future 3.0 release. |
Resolves #157 & #158
Changes
mocha
withnode --test
scriptexpect
fromchai
withnode:assert