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

Adding --noStackTrace #985

Closed
craigdallimore opened this issue May 10, 2016 · 4 comments
Closed

Adding --noStackTrace #985

craigdallimore opened this issue May 10, 2016 · 4 comments

Comments

@craigdallimore
Copy link

It appears that adding --noStackTrace does not suppress the stack trace - at least I presume I should not get so much output when using this feature. Sometimes I get over 100 lines of logging, which puts the details of the failing test off my screen - so I'm interested in reducing the noise somehow.

Details

"jest-cli": "^12.0.2"

from package.json:

  "jest": {
    "collectCoverage": false,
    "bail": true,
    "testFileExtensions": [
      "js"
    ],
    "moduleFileExtensions": [
      "js",
      "jsx",
      "json"
    ],
    "unmockedModulePathPatterns": [
      "<rootDir>/node_modules"
    ],
    "testDirectoryName": "__tests__",
    "testPathDirs": [
      "./src/js"
    ]
  },

from .babelrc:

{
  "presets": [
    "react",
    "es2015"
  ],
  "plugins": [
    "transform-runtime"
  ]
}
@cpojer
Copy link
Member

cpojer commented May 12, 2016

I'll fix this for the next version of Jest :)

@cpojer
Copy link
Member

cpojer commented May 12, 2016

Going to close this out in favor of the pull request. The new Jest release will come out soon.

@cpojer cpojer closed this as completed May 12, 2016
ghost pushed a commit that referenced this issue May 12, 2016
Summary:
The reporting code is a huge mess. This simplifies a bunch of things and makes everything go through the same code path and makes `noStackTrace` work again which hasn't worked properly for maybe half a year.

Fixes included:
* When a single test is run and it throws a runtime error, we now show the "1 test suite failed" message.
* Runtime errors, string errors and error objects thrown in tests now all render the same way and go through a single code path.
* Stack trace printing can be disabled with `--noStackTrace`

yay, regex

Fixes #985.

bypass-lint
Closes #997

Reviewed By: dmitriiabramov

Differential Revision: D3292096

fbshipit-source-id: bb4ce5cb2721327f701c86681c441df98fd57f28
@lemoustachiste
Copy link

Hi,

it seems I am still experiencing the issue. Here is an abridged log that I am receiving to highlight that the stack trace is present in the output:

...decodeFirstSync,t.diagnose=t.Diagnose.diagnose,t.encode=t.Encoder.encode,t.encodeCanonical=t.Encoder.encodeCanonical,t.encodeOne=t.Encoder.encodeOne,t.encodeAsync=t.Encoder.encodeAsync,t.decode=t.Decoder.decodeFirstSync,t.leveldb={decode:t.Decoder.decodeAllSync,encode:t.Encoder.encode,buffer:!0,name:"cbor"},t.hasBigInt=ms.hasBigInt}));Cc.BigNumber,Cc.Commented,Cc.Diagnose,Cc.Decoder,Cc.Encoder,Cc.Simple,Cc.Tagged,Cc.Map,Cc.comment,Cc.decodeAll,Cc.decodeFirst,Cc.decodeAllSync,Cc.decodeFirstSync,Cc.diagnose,Cc.encode,Cc.encodeCanonical,Cc.encodeOne,Cc.encodeAsync,Cc.decode,Cc.leveldb,Cc.hasBigInt;var Nc=class{constructor(e,t,r,n){this.name=e,this.code=t,this.alphabet=n,r&&n&&(this.engine=r(n))}encode(e){return this.engine.encode(e)}decode(e){return this.engine.decode(e)}isImplemented(){return this.engine}},Mc=j((function(e,t){
      19 | /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */

      at wi (dist/verifier-es.js:16:67925)
      at _i (dist/verifier-es.js:16:68052)
      at dist/verifier-es.js:16:69846
      at Object.next (dist/verifier-es.js:16:69747)
      at a (dist/verifier-es.js:16:68183)

The error and stack matters little in my case, since I am running a sanity check on my build. But since I am trying to debug, the output of the whole stack and code hides what I am looking for.

My cli command is:
jest --noStackTrace --testRegex "/*(.test.build.js)". I cannot use --silent since then this suppresses console.logs and I need those to debug the test.

Jest version: 25.5.4

@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 28, 2021
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 a pull request may close this issue.

3 participants