testing-library / dom-testing-library

🐙 Simple and complete DOM testing utilities that encourage good testing practices.
https://testing-library.com/dom
MIT License
3.26k stars 466 forks source link

test: Checking Bun compatibility #1264

Closed eps1lon closed 1 year ago

eps1lon commented 1 year ago

Checking if the repo is compatible with Bun. There's on test assertion that needed changing and I'm pretty sure that's a bug in Bun.

I wonder if all the kcd-script calls actually use Bun since they have a shebang that wants Node.js. Type-checking shows only 10% difference:

$ hyperfine "npx kcd-scripts typecheck --
build types"
Benchmark 1: npx kcd-scripts typecheck --build types
  Time (mean ± σ):      2.384 s ±  0.049 s    [User: 4.826 s, System: 0.204 s]
  Range (min … max):    2.326 s …  2.493 s    10 runs

$ hyperfine "bunx kcd-scripts typecheck -
-build types"
Benchmark 1: bunx kcd-scripts typecheck --build types
  Time (mean ± σ):      2.191 s ±  0.082 s    [User: 4.552 s, System: 0.183 s]
  Range (min … max):    2.125 s …  2.401 s    10 runs

bun run format works locally but not in CI:

Run bun run format --check --no-write
$ kcd-scripts format --check --no-write
/usr/bin/bash: line [1](https://github.com/testing-library/dom-testing-library/actions/runs/6206581608/job/16850977595?pr=1264#step:4:1): kcd-scripts: command not found
codesandbox-ci[bot] commented 1 year ago

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 3e93ef4d83c81b973073708d4d3f5688839f808a:

Sandbox Source
react-testing-library-examples Configuration
eps1lon commented 1 year ago

All the CI steps work locally but not in CI. This is not something I wish to debug. But good to know we can potentially debug Bun compat issues locally.