jestjs / jest

Delightful JavaScript Testing.
https://jestjs.io
MIT License
44.21k stars 6.46k forks source link

[Bug]: Formatting of error messages sometimes is missing all information #14058

Closed Nokel81 closed 1 year ago

Nokel81 commented 1 year ago

Version

29.5.0

Steps to reproduce

  1. Clone lensapp/lens branch fix-electron-main-decorator
  2. Run npm i and then npm run build -- --ignore open-lens
  3. Run cd packages/core
  4. Run npx jest --watch packages/core/src/features/telemetry/emit-telemetry-for-show-details-calls.test.ts

Expected behavior

The test suite to run in watch mode

Actual behavior

  ● Test suite failed to run

thrown: [Error]

Additional context

I found via using rg that the formatter is jest-message-util and playing around with it I switch the formatter to be util.inspect (from node's STL) and then I got the following extra details:

Error
    at ChildProcess.spawn (node:internal/child_process:413:11)
    at Object.spawn (node:child_process:700:9)
    at execa (/Users/nokel81/repos/lens/node_modules/jest-changed-files/node_modules/execa/index.js:83:26)
    at Object.findChangedFiles (/Users/nokel81/repos/lens/node_modules/jest-changed-files/build/sl.js:104:43)
    at /Users/nokel81/repos/lens/node_modules/jest-changed-files/build/index.js:51:17
    at Array.map (<anonymous>)
    at getChangedFilesForRoots (/Users/nokel81/repos/lens/node_modules/jest-changed-files/build/index.js:50:43)
    at processTicksAndRejections (node:internal/process/task_queues:96:5) {
  errno: -63,
  code: 'ENAMETOOLONG',
  syscall: 'spawn',
  originalMessage: 'spawn ENAMETOOLONG',
  shortMessage: 'Command failed with ENAMETOOLONG: sl status -amnu /Users/nokel81/repos/lens/packages/core\n' +
    'spawn ENAMETOOLONG',
  command: 'sl status -amnu /Users/nokel81/repos/lens/packages/core',
  escapedCommand: 'sl status -amnu "/Users/nokel81/repos/lens/packages/core"',
  exitCode: undefined,
  signal: undefined,
  signalDescription: undefined,
  stdout: '',
  stderr: '',
  all: '',
  failed: true,
  timedOut: false,
  isCanceled: false,
  killed: false
}

Environment

System:
    OS: macOS 12.6.3
    CPU: (12) x64 Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz
  Binaries:
    Node: 16.16.0 - ~/.nvm/versions/node/v16.16.0/bin/node
    Yarn: 1.22.19 - ~/.yarn/bin/yarn
    npm: 8.19.4 - ~/repos/lens/node_modules/.bin/npm
mrazauskas commented 1 year ago

I got the same output today because of #14046. Is this the reason?

Nokel81 commented 1 year ago

oh wow yes I think so. I raw that command locally and was very confused when I got the steam locomotive animation

Nokel81 commented 1 year ago

Closing as duplicate of that issue. Doing brew uninstall sl fixes my issue. I wonder why it was reporting ENAMETOOLONG though

github-actions[bot] commented 1 year ago

This issue 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.