gemini-testing / gemini-testing/testplane
Restrict error message length
- Dominant language
- TypeScript
- Stars
- 830
- Forks
- 76
- Avg merge
- 4d 10h
- Merged PRs (30d)
- 14
Description
### Description
We should truncate error message to readable size, so that users would only see start of error message, if its large, which is usually the most useful part of long error message.
When resolving the issue, it also worth to pay extra attention to code snippets, where error message is also shown:
https://github.com/gemini-testing/testplane/blob/master/src/error-snippets/index.ts#L29
### Verify latest release
- [x] I verified that the issue exists in the latest Testplane release
### Testplane version
_No response_
### Last Testplane version that worked
_No response_
### Which area(s) of Testplane are affected? (leave empty if unsure)
Runner
### Link to the code that reproduces this issue or a replay of the bug
_No response_
### Reproduction steps
- Build up new project using "npm init testplane@latest my-project"
- Modify generated test so it would produce extra long error message
- This error message is shown fully in console and in html-report
Test with long error message example:
```ts
describe("test", () => {
it("example", async () => {
throw new Error("1234567890".repeat(1000));
});
});
```
### Actual Behavior
Error message is large and not truncated:
### Expected Behavior
Error message is truncated to reasonable size. Users can configure maximum error length from config.
### Which Node.js version are you using?
20.11.0
_Internal issue: https://nda.ya.ru/t/JD_HOekG7JhH2V_
Contributor guide
Assessment
This issue has not been assessed yet.