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

Fix error message for sl (steam locomotive) #15052

Merged
merged 2 commits into from
May 8, 2024

Conversation

rmartine-ias
Copy link
Contributor

Summary

When running jest in watch mode, with sl installed
(https://github.com/mtoyoda/sl), it errors out with the following
message:

  ● Test suite failed to run

thrown: [Error]

This is bad because the error is extremely hard to debug.

This change makes it error as follows:

  ● Test suite failed to run

    Command failed with ENAMETOOLONG: sl status -amnu /Users/rmartine/dev/ias-backstage/packages/backend
    spawn ENAMETOOLONG

This, at least, points people in the right direction.

See also: #14046

Test plan

Went to a project that uses jest, ensured sl was installed and on $PATH, and ran:

$ node /path/to/your/JestClone/packages/jest/bin/jest --watch

Confirmed error was as before:

Determining test suites to run...

  ● Test suite failed to run

thrown: [Error]

Made my changes, re-ran:

$ node /path/to/your/JestClone/packages/jest/bin/jest --watch

Confirmed error message is now descriptive:

Determining test suites to run...

  ● Test suite failed to run

    Command failed with ENAMETOOLONG: sl status -amnu /Users/rmartine/dev/ias-backstage/packages/backend
    spawn ENAMETOOLONG

When running jest in watch mode, with `sl` installed
(https://github.com/mtoyoda/sl), it errors out with the following
message:

```
  ● Test suite failed to run

thrown: [Error]
```

This is bad because the error is extremely hard to debug.

This change makes it error as follows:

```
  ● Test suite failed to run

    Command failed with ENAMETOOLONG: sl status -amnu /Users/rmartine/dev/ias-backstage/packages/backend
    spawn ENAMETOOLONG
```

This, at least, points people in the right direction.

See also: jestjs#14046
Copy link

linux-foundation-easycla bot commented May 3, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

Copy link

netlify bot commented May 3, 2024

Deploy Preview for jestjs ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 0067f96
🔍 Latest deploy log https://app.netlify.com/sites/jestjs/deploys/6639888ae0fd7f00080eb8d3
😎 Deploy Preview https://deploy-preview-15052--jestjs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@vegerot
Copy link
Contributor

vegerot commented May 3, 2024

minor: just make the error message say "This is probably because you have Steam Locomotive installed. Jest cannot be used with Steam Locomotive installed."

@rmartine-ias
Copy link
Contributor Author

Well, now it can. See my other PR: #15053


throw error;
}
const result = await execa('sl', args, {cwd, env});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we make the same change for all the VCS checks? trying to silence the error doesn't really seem useful in this case

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made the change, added changelog entry!

Copy link
Member

@SimenB SimenB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@SimenB SimenB merged commit 85bab0e into jestjs:main May 8, 2024
84 checks passed
@SimenB
Copy link
Member

SimenB commented May 12, 2024

Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants