Comments (2)
Thanks for providing a working repro. I appreciate that since it takes the guesswork out.
You can fix this in your code by always rejecting promises with an instance of Error
(and there's the eslint prefer-promise-reject-errors rule to help with that). But I don't think there's much Jasmine can do once a promise has been rejected with a non-Error
reason. The problem is that only Error
instances have stack traces. So unless the promise is rejected with an Error
, there's no way to recover the source of the rejection later on.
When an expectation fails, Jasmine is able to obtain a stack trace by constructing its own Error
. But that only works because the source of the failure is still on the call stack. That's not the case with a returned promise or an unhandled promise rejection.
from jasmine.
I added https://jasmine.github.io/pages/faq.html#promise-no-stacktrace for this.
from jasmine.
Related Issues (20)
- Monkey patching jasmine pending function
- Fails to parse error without message.
- Problem with using formArrayName in test cases HOT 1
- Use globalThis instead of jasmineGlobal HOT 1
- filename is incorrect when run with angular test. HOT 1
- Add a matcher for `x === undefined || x === null` and/or `x !== undefined || x !== null` HOT 2
- Expected object to be a kind of Object, but was <anonymous> HOT 3
- Error using throwUnless: ReferenceError: throwUnless is not defined HOT 2
- Unhandled Promise rejections are not logged HOT 1
- There Should be an Option to Show a Message on Assert Success HOT 1
- License URL Missing from NuGet Package HOT 1
- Accessing #private properties as a Jasmine feature HOT 1
- `throwUnlessAsync` is actually `throwUnless` HOT 4
- Custom metadata for tests HOT 1
- Structured data in Error.cause results in TypeError: Cannot read properties of undefined (reading 'split') HOT 4
- "ResizeObserver loop completed with undelivered notifications" makes Jasmine fail with empty error message HOT 8
- Sometime it show the code sometime it didn't show the code HOT 1
- TS - Won't work with modules HOT 1
- How to ask Ai to write a unit testcase HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jasmine.