power-assert icon indicating copy to clipboard operation
power-assert copied to clipboard

Display all frames of the stack

Open OoDeLally opened this issue 8 years ago • 1 comments

Currently, only the first frame is shown:

# src/foo/bar/baz.js:37
  
  assert(_.isArray(nodes) && nodes.length > 0 && _.every(nodes, node => node instanceof Node))
         | |       |      |  |     |      |   |                                               
         | |       |      |  |     |      |   false                                           
         | |       |      |  []    0      false                                               
         | true    []     false                                                               
         #function#                               

Is it possible to get all the frames that led to that assertion? That would be really helpful.

e.g.

# src/foo/bar/baz.js:37
  
  assert(_.isArray(nodes) && nodes.length > 0 && _.every(nodes, node => node instanceof Node))
         | |       |      |  |     |      |   |                                               
         | |       |      |  |     |      |   false                                           
         | |       |      |  []    0      false                                               
         | true    []     false                                                               
         #function#         

at src/foo/hello_you.js:45
at src/foo/hello.js:154
at src/foo/greeting.js:48

Thank you

OoDeLally avatar Sep 07 '17 08:09 OoDeLally

@OoDeLally Thank you for your question. Would you give me a bit more information?

  • OS
  • Node version
  • Testing framework (Mocha, ...) or vanilla Node

Since stack traces are automatically suppressed under some environments Thanks.

twada avatar Sep 07 '17 08:09 twada