-
Notifications
You must be signed in to change notification settings - Fork 34
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
No stack trace is provided for unhandled errors during tests #439
Comments
This one is very strange - I was sure that we were printing out the stack. Do you have a link to this test @jhm-ciberman? |
The test was generated by a typo (I wrote The code used was the following. If you need, I can create a fork of my own project and reproduce the bug inside it so you can take a closer look: @Test("checkGMLFeaturesMatchDocs should validate a valid script with a non optional param")
public checkGMLFeaturesMatchDocs_Valid_Params_nonOptional() {
class MockGMLParser implements IGMLParser {
public countFixedArguments(): number {
throw 1; //Note the typo of "throw" instead of "return"
}
public countOptionalArguments(): number {
throw 0; //Note the typo of "throw" instead of "return"
}
public hasReturn(): boolean {
throw true; //Note the typo of "throw" instead of "return"
}
}
const docScript = new DocScript();
const argument0 = this._createParam("My param", "param_name", false, "real");
docScript.params.push(argument0);
docScript.undocumented = false;
const validator = new Validator(docScript, this.config);
const parser = new MockGMLParser();
Expect(validator.checkGMLFeaturesMatchDocs(parser)).toBe(true);
} |
Thanks @jhm-ciberman I think this is probably enough to go on for now but I suspect the reason is the literal types don't have a trace associated with them but we may still be able to get something useful out of this scenario. |
JavaScript allows throwing anything, so sadly there won't be a great stack trace for this scenario. However, we can still create a stack trace, and manipulate the stack if needed. Proof Of Concept
Output
|
No stack trace is provided for unhandled errors during tests
The text was updated successfully, but these errors were encountered: