You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Vitest is another fairly lightweight option for jest-compatible test runner. My last experience was that Jest is terrible to use with ESM as it doesn't fully support it yet. vitest is much better in this regard.
I just realized that I already migrated it to jest a while go haha. if anyone is interested in migrating to node's official test runner, that would be great. otherwise, I will leave it as is
I just pinned this issue. Also I merged a core bug fix just a bit ago at #1593 which fixes #1547 – tldr; HEAD requests with http2 server instance were broken and not working.
I know this is blasphemy these days, so at the risk of sounding like a luddite, I have to beg you, PLEASE, PLEASE don't convert Koa to ESM-Only unless you'll be actively updating/patching the v2 branch for an extended period of time (like multiple years).
Migrating existing NodeJS codebases to ESM still isn't effortless, and going to ESM-only risks leaving CJS users in a vulnerable state where they can't safely upgrade to incorporate security patches and critical bug fixes.
I know this is blasphemy these days, so at the risk of sounding like a luddite, I have to beg you, PLEASE, PLEASE don't convert Koa to ESM-Only unless you'll be actively updating/patching the v2 branch for an extended period of time (like multiple years).
Migrating existing NodeJS codebases to ESM still isn't effortless, and going to ESM-only risks leaving CJS users in a vulnerable state where they can't safely upgrade to incorporate security patches and critical bug fixes.
why would you want to migrate existing codebases to a semver incompatible version of a web framework without upgrading Node.js?
starting version 20.x you can require(esm) so in case you're on that version, you can safely use Koa as ESM
@jonathanong I have a big thank for your hard working, but I'm worried about how many popular middlewares will be broken by this major upgrading, do we have a draft list in the latest migration guide?
Activity
jaydenseric commentedon Aug 29, 2024
Regarding the goal to move to Jest; please don't. Use the native Node.js test runner! It should be more than adequate.
You can pair it with
coverage-node, a very lightweight CLI tool, to enforce 100% code coverage in tests:https://github.com/jaydenseric/coverage-node
v1rtl commentedon Aug 29, 2024
to add, Node test runner has identical API to Jest
for assertion,
node:assertcould be usedbenmccann commentedon Aug 30, 2024
Vitest is another fairly lightweight option for jest-compatible test runner. My last experience was that Jest is terrible to use with ESM as it doesn't fully support it yet. vitest is much better in this regard.
A rewrite might also be a nice time to take a look at including only minimal dependencies (e.g. https://npmgraph.js.org/?q=koa vs https://npmgraph.js.org/?q=polka)
jonathanong commentedon Aug 31, 2024
I just realized that I already migrated it to jest a while go haha. if anyone is interested in migrating to node's official test runner, that would be great. otherwise, I will leave it as is
Use node test runner (#1845)
titanism commentedon Feb 27, 2025
I just pinned this issue. Also I merged a core bug fix just a bit ago at #1593 which fixes #1547 – tldr;
HEADrequests withhttp2server instance were broken and not working.titanism commentedon Feb 27, 2025
👍 to
c8https://www.npmjs.com/package/c8 and Node's native testing👍 to using
npfor releasesjonathanong commentedon Apr 6, 2025
Just need to spend time to write a migration doc for v3 and then I am going to launch it
jrnail23 commentedon Apr 18, 2025
I know this is blasphemy these days, so at the risk of sounding like a luddite, I have to beg you, PLEASE, PLEASE don't convert Koa to ESM-Only unless you'll be actively updating/patching the v2 branch for an extended period of time (like multiple years).
Migrating existing NodeJS codebases to ESM still isn't effortless, and going to ESM-only risks leaving CJS users in a vulnerable state where they can't safely upgrade to incorporate security patches and critical bug fixes.
v1rtl commentedon Apr 18, 2025
why would you want to migrate existing codebases to a semver incompatible version of a web framework without upgrading Node.js?
starting version 20.x you can require(esm) so in case you're on that version, you can safely use Koa as ESM
jonathanong commentedon Apr 28, 2025
let me know if anyone contributed that I missed in the release notes https://github.com/koajs/koa/releases/tag/v3.0.0
TechQuery commentedon Apr 28, 2025
@jonathanong I have a big thank for your hard working, but I'm worried about how many popular middlewares will be broken by this major upgrading, do we have a draft list in the latest migration guide?
jonathanong commentedon Apr 28, 2025
@TechQuery it should just be
sendor any middleware that serves from the filesystem due to the ENOENT removal, I will take a look laterjonathanong commentedon Apr 28, 2025
actually,
sendhandles ENOENT itself. looks like tests are passing with koa@3 so we're goodtitanism commentedon Apr 29, 2025
Koa v3.0 was featured in Node Weekly today at https://nodeweekly.com/issues/576 as was our @forwardemail blog post https://forwardemail.net/en/blog/docs/how-npm-packages-billion-downloads-shaped-javascript-ecosystem 🚀
Use node test runner (#1845)