berry: [Bug] running just `yarn` doesn't install
- I’d be willing to implement a fix
Describe the bug
Running yarn in v2 gives this error:
yarn
Usage Error: Couldn't find a script named "".
$ yarn run <scriptName> ...
Since we can’t run a script named empty string, the previous default of installing makes more sense
To Reproduce
Running just yarn gives this error, regardless of environment.
await packageJsonAndInstall({});
await expect(yarn()).resolves.toBeTruthy();
Environment if relevant (please complete the following information):
- Yarn version: 2.0.0-rc.26
Additional context
in v1 this installed
About this issue
- Original URL
- State: open
- Created 4 years ago
- Comments: 20 (12 by maintainers)
The reproduction case in your issue seems broken (ie it neither pass nor fail due to throwing an unmanaged exception):
Remember: any non-Jest exceptions will cause the test to be reported as broken. If you expect something to pass without throwing, you must wrap it into something like
await expect(...).resolves.toBeTruthy(). If you instead expect something to throw, you need to wrap it intoawait expect(...).rejects.toThrow().