From 19307572968a4ae3607993a30087877dde58b721 Mon Sep 17 00:00:00 2001 From: shadowusr Date: Mon, 25 Sep 2023 12:43:18 +0300 Subject: [PATCH] fix: add error name by default --- lib/errors/index.ts | 1 + lib/test-adapter/playwright.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/errors/index.ts b/lib/errors/index.ts index a3acaf709..0e6b1d449 100644 --- a/lib/errors/index.ts +++ b/lib/errors/index.ts @@ -3,6 +3,7 @@ import {DiffOptions, ImageData} from '../types'; import {ValueOf} from 'type-fest'; export const ErrorName = { + GENERAL_ERROR: 'Error', IMAGE_DIFF: 'ImageDiffError', NO_REF_IMAGE: 'NoRefImageError', ASSERT_VIEW: 'AssertViewError' diff --git a/lib/test-adapter/playwright.ts b/lib/test-adapter/playwright.ts index 6d98665df..3c2f797e1 100644 --- a/lib/test-adapter/playwright.ts +++ b/lib/test-adapter/playwright.ts @@ -153,7 +153,7 @@ export class PlaywrightTestAdapter implements ReporterTestResult { get error(): TestError | undefined { const message = extractErrorMessage(this._testResult); if (message) { - const result: TestError = {message}; + const result: TestError = {name: ErrorName.GENERAL_ERROR, message}; const stack = extractErrorStack(this._testResult); if (stack) {