Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bun support #242

Open
suuunly opened this issue Oct 11, 2024 · 6 comments
Open

Bun support #242

suuunly opened this issue Oct 11, 2024 · 6 comments

Comments

@suuunly
Copy link

suuunly commented Oct 11, 2024

Hey, I wanted to use the latest yeoman-test library, but when I run it I get the following error:

# Unhandled error between tests
-------------------------------
error: Cannot find package "node:test" from "/Users/my-path/generator-bun-app/node_modules/yeoman-test/dist/adapter.js"
-------------------------------

The project is written in Bun 1.1.24.
Do you have any plans for supporting bun? Or perhaps you know of a clever solution around this issue, where I can add node:test to the package? 😁

Thank you, any help is much appreciated! ❤️

@mshima
Copy link
Member

mshima commented Oct 11, 2024

Have you followed node requirements?

"node": "^18.19.0 || >= 20.6.1"

@mshima
Copy link
Member

mshima commented Oct 11, 2024

node:test is a built-in node module:
https://nodejs.org/api/test.html#mockfnoriginal-implementation-options

mock.fn([original[, implementation]][, options])[#](https://nodejs.org/api/test.html#mockfnoriginal-implementation-options)

Added in: v19.1.0, v18.13.0

@mshima
Copy link
Member

mshima commented Oct 11, 2024

Ok it's not using node.
Another runtime https://bun.sh.

node:test support status
https://bun.sh/docs/runtime/nodejs-apis#node-test

@mshima
Copy link
Member

mshima commented Oct 11, 2024

See oven-sh/bun#5090.
I can drop node: prefix if https://www.npmjs.com/package/test works for you.

@suuunly
Copy link
Author

suuunly commented Oct 14, 2024

Hey @mshima
Thank you for the swift reply! ❤️

I tried installing the suggested default npm test library, which worked fine.
I then tried to hop into the node_modules/yeoman-test, and removed the node: prefix on all the node:test references. Which then results in the following error:

error: Cannot find package "yeoman-environment" from "/Users/my-path/generator-bun-app/node_modules/yeoman-test/dist/default-environment.js"

So I think it may be a more integrated issue than just node:test. Which is fair, since you've not focused on Bun 😁

@mshima
Copy link
Member

mshima commented Oct 14, 2024

yeoman-environment is an optional dependency.
You should install manually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants