Open jbergstroem opened 1 year ago
Does it make sense to add a PR about it not being supported in the documentation?
My usage is to use one test code to test both bun and node compatibility. Why bun can recogonize the 'test' module?
❯ t
> fetch-github-trending@0.0.1 test
> bun test
bun test v1.0.25 (a8ff7be6)
test/index.test.ts:
error: Cannot find package "test" from "/Users/yutengjing/code/fetch-github-trending/test/index.test.ts"
0 pass
1 fail
Ran 1 tests across 1 files. [5.00ms]
Hey @jbergstroem do we have any solution/alias to this?
We are currently trying to run our test suite (written with node:test
) using bun to ensure it works on both node.js and bun.js.
I'm not sure, but probably adding support for https://github.com/nodejs/node-core-test should be the aimed solution here.
node core test package in bun throws these two errors:
❯ bun test
bun test v1.0.30 (1424a196)
test/components.test.tsx:
[bun] Warning: async_hooks.executionAsyncId/triggerAsyncId are not implemented in Bun. It will return 0 every time.
[bun] Warning: async_hooks.createHook is not implemented in Bun. Hooks can still be created but will never be called.
0 pass
0 fail
Ran 0 tests across 1 files. [601.00ms]
What is the problem this feature would solve?
As part of evaluating/migrating to bun from node, it is cumbersome to use both
node:test
andbun:test
at the same time.What is the feature you are proposing to solve the problem?
bun
should support thenode:test
built-in API.What alternatives have you considered?
Maintain a separate suite or use branching logic.