mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-24 20:51:13 -05:00
Improve error formatting in tests
- Replace [object Object] errors with readable messages by using robust error formatting across test suites - Introduce formatTestError helper and apply it in all catch blocks and error throws - Update approvalPipelineTests and related suites to utilize improved error extraction for better debugging
This commit is contained in:
@@ -8,7 +8,8 @@
|
||||
|
||||
import { supabase } from '@/lib/supabaseClient';
|
||||
import { TestDataTracker } from '../TestDataTracker';
|
||||
import {
|
||||
import { formatTestError } from '../formatTestError';
|
||||
import {
|
||||
submitParkCreation,
|
||||
submitRideCreation,
|
||||
submitManufacturerCreation,
|
||||
@@ -18,6 +19,9 @@ import {
|
||||
submitRideModelCreation
|
||||
} from '@/lib/entitySubmissionHelpers';
|
||||
|
||||
// Re-export formatTestError for use in test suites
|
||||
export { formatTestError } from '../formatTestError';
|
||||
|
||||
// ============================================
|
||||
// AUTHENTICATION
|
||||
// ============================================
|
||||
@@ -416,7 +420,7 @@ export async function approveSubmission(
|
||||
const duration = performance.now() - startTime;
|
||||
return {
|
||||
success: false,
|
||||
error: error instanceof Error ? error.message : String(error),
|
||||
error: formatTestError(error),
|
||||
duration,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user