You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Error enumerable properties are not shown for test case:
import { test } from 'vitest';
test('throw error with context', () => {
const err = new Error('This is an error with context');
err.userId = 32;
err.companyId = 64;
throw err;
})
Suggested solution
Show enumerable properties on errors as node does by default:
Alternative
At the very least please add an option to opt in for this behavior.
Additional context
When calling a function transformSomething(array) the function might have many iterations inside but one iteration will fail becaue the item may be invalid. It's very useful when throwing an error, especially for logging to specify which iteration failed.
Clear and concise description of the problem
Error enumerable properties are not shown for test case:
Suggested solution
Show enumerable properties on errors as node does by default:
Alternative
At the very least please add an option to opt in for this behavior.
Additional context
When calling a function transformSomething(array) the function might have many iterations inside but one iteration will fail becaue the item may be invalid. It's very useful when throwing an error, especially for logging to specify which iteration failed.
For more context here is the equivalent issue for chromium dev tools console https://bugs.chromium.org/p/chromium/issues/detail?id=1251322&q=enumerable&can=2
Validations
The text was updated successfully, but these errors were encountered: