/
githubmirror
/
lerna
Обзор
Документация
Войти
/
githubmirror
/
lerna
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
libs/e2e-utils/src/lib/serializers/serialize-error-message.ts
17 строк
720 B
James Henry
chore(repo): migrate from jest to vitest (#4389)
13 июл 2026, 20:06
Не верифицирован
13 июл 2026, 20:06
1f7e109
Код
Авторство
О чём код?
import type { SnapshotSerializer } from "vitest"; /** * Vitest passes thrown Error objects to snapshot serializers, whereas jest * passed the message string. Unwrap the message and re-dispatch it through the * serializer chain so that each suite's own string-based serializer (path and * environment normalization) still applies to snapshotted errors. * * Registered for every e2e project via defineLernaE2eVitestConfig. */ const errorMessageSerializer: SnapshotSerializer = { test: (thing: unknown) => thing instanceof Error, serialize: (thing, config, indentation, depth, refs, printer) => printer((thing as Error).message, config, indentation, depth, refs), }; export default errorMessageSerializer;