Jest now uses SWC to transpile the Node SDK tests, with the same ES2022
target and legacy decorator semantics as the SDK. The Node and Arrow
compatibility jobs run the existing test TypeScript project through `tsc
--noEmit` after building the SDK. Contributors can run that check with
`pnpm run typecheck:tests`.
Closes#2234.
Measured on Windows x64 with Node 22.23.4, Jest 29.7, the default native
features and one Jest process (`--runInBand --silent`). Both runs used
the same 0.42.0-beta.26 Windows native binary. Times below are
wall-clock seconds.
| Workload | ts-jest | SWC |
| --- | ---: | ---: |
| Six suites, empty Jest cache (median of three) | 8.31 | 4.22 |
| Same six suites, populated cache (median of three) | 4.45 | 3.52 |
| Full default suite, empty Jest cache (one run each) | 50.10 | 38.55 |
The six suites were `arrow`, `expr`, `materialized_view`, `package`,
`registry` and `sanitize`. Each pair started with a fresh Jest cache
directory and immediately reused it on the second run. The separate test
type check took 3.39 s, bringing the full SWC run plus type checking to
41.94 s on this machine.
Both full runs passed the same 1,882 tests with 28 skipped. The SDK
TypeScript build, test type check, Biome checks and TypeDoc build also
passed.
---------
Co-authored-by: lipeih <lipeihan@eazytec.com>
OAuth tests set `LANCEDB_OAUTH_BROWSER` inside Jest's sandbox, which
does not update the process environment read by Rust. As a result, the
native login flow launches a real browser; the [failing macOS main
job](https://github.com/lancedb/lancedb/actions/runs/35067074667/job/104699667840)
ends by terminating an orphaned Safari process.
Set the no-op browser helper while loading Jest configuration, before
creating sandboxes and workers, so both local and CI tests inherit it.
Check the inherited process environment before OAuth login to catch
regressions without opening a browser. Windows uses a no-op command
fixture. Test deadlines and worker counts are unchanged.
A negative control restoring the sandbox-only assignment fails in the
new pre-login check. The full macOS test suite passes with the standard
test launcher; the Windows helper has not been executed locally. The
[first hosted macOS
run](https://github.com/lancedb/lancedb/actions/runs/35071525843/job/104713928139)
passes all 843 tests (5 skipped), with no Safari process in the job log.
Further normal runs are needed to establish sustained stability.
This is done as setup for a PR that will fix the OpenAI dependency
issue.
* [x] FTS examples
* [x] Setup mock openai
* [x] Ran `npm audit fix`
* [x] sentences embeddings test
* [x] Double check formatting of docs examples
The eslint rules specify some formatting requirements that are rather
strict and conflict with vscode's default formatter. I was unable to get
auto-formatting to setup correctly. Also, eslint has quite recently
[given up on
formatting](https://eslint.org/blog/2023/10/deprecating-formatting-rules/)
and recommends using a 3rd party formatter.
This PR adds prettier as the formatter. It restores the eslint rules to
their defaults. This does mean we now have the "no explicit any" check
back on. I know that rule is pedantic but it did help me catch a few
corner cases in type testing that weren't covered in the current code.
Leaving in draft as this is dependent on other PRs.