feat: improved ueberdb speed and esm compatibility#952
Conversation
ⓘ You've reached your Qodo monthly free-tier limit. Reviews pause until next month — upgrade your plan to continue now, or link your paid account if you already have one. |
Review Summary by QodoMigrate test suite from Vitest to Node.js native test runner
WalkthroughsDescription• Migrate test suite from Vitest to Node.js native test runner • Replace Vitest assertions with Node.js assert module • Update test hooks from Vitest to Node.js equivalents (beforeAll→before, afterAll→after) • Remove Vitest dependency and update test command in package.json • Use fileURLToPath for __filename compatibility in ESM tests Diagramflowchart LR
A["Vitest Test Framework"] -->|Replace| B["Node.js Native Test Runner"]
C["Vitest Assertions"] -->|Replace| D["Node.js assert/strict Module"]
E["Vitest Hooks<br/>beforeAll/afterAll"] -->|Replace| F["Node.js Hooks<br/>before/after"]
G["__filename in ESM"] -->|Replace| H["fileURLToPath import.meta.url"]
I["package.json vitest script"] -->|Remove| J["Use node --test command"]
File Changes1. test/lib/test_lib.ts
|
Code Review by Qodo
1. CI test matrix broken
|
| "build": "pnpm run build:js && pnpm run build:types", | ||
| "build:js": "pnpm exec rolldown -c rolldown.config.mjs", | ||
| "build:types": "pnpm exec tsc --emitDeclarationOnly", | ||
| "test": "vitest --test-timeout=120000", | ||
| "test": "node --experimental-strip-types --test --test-timeout=120000 test/**/*.spec.ts", | ||
| "ts-check": "tsc --noEmit", |
There was a problem hiding this comment.
1. Ci test matrix broken 🐞 Bug ☼ Reliability
The new test script does not handle the existing workflow’s pnpm run test <db> invocation, so the extra argument will be forwarded to node --test as a test file/pattern and can fail or run unintended tests. This will break the npmpublish.yml test job matrix and can also cause every matrix shard to run the entire test suite instead of a single DB target.
Agent Prompt
## Issue description
The `test` script no longer supports `pnpm run test <db>` used by the GitHub Actions matrix, so the workflow will forward `<db>` to `node --test` as an extra positional argument (file/pattern), breaking CI and eliminating per-DB sharding.
## Issue Context
The workflow intentionally runs one DB suite per job (`matrix.db`). With Vitest this could be achieved by passing an argument; with Node’s test runner you need to either:
- pass an explicit test file/glob per db, or
- use `--test-name-pattern` to select tests by suite name.
## Fix Focus Areas
- package.json[134-145]
- .github/workflows/npmpublish.yml[11-53]
## Suggested fix approach
- Update the `test` script to accept an optional argument and translate it into a file glob (recommended). For example:
- `pnpm run test couch` => run `test/couch/**/*.spec.ts`
- `pnpm run test mysql` => run `test/mysql/**/*.spec.ts`
- `pnpm run test mongo` => run `test/mongodb/**/*.spec.ts`
- Or update the workflow to call `node --test` with the correct file glob directly instead of passing a db argument.
- Ensure `pnpm run test` (no args) still runs the full suite locally if desired.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
No description provided.