mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-23 14:11: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:
@@ -126,7 +126,7 @@ export const performanceTestSuite: TestSuite = {
|
||||
.select('id')
|
||||
.single();
|
||||
|
||||
if (parkError) throw parkError;
|
||||
if (parkError) throw new Error(`Park creation failed: ${parkError.message}`);
|
||||
parkId = park.id;
|
||||
tracker.track('parks', parkId);
|
||||
|
||||
@@ -214,7 +214,7 @@ export const performanceTestSuite: TestSuite = {
|
||||
|
||||
const modDuration = Date.now() - modStart;
|
||||
|
||||
if (modError) throw modError;
|
||||
if (modError) throw new Error(`Moderator check failed: ${modError.message}`);
|
||||
|
||||
// Test is_user_banned function performance
|
||||
const banStart = Date.now();
|
||||
@@ -225,7 +225,7 @@ export const performanceTestSuite: TestSuite = {
|
||||
|
||||
const banDuration = Date.now() - banStart;
|
||||
|
||||
if (banError) throw banError;
|
||||
if (banError) throw new Error(`Ban check failed: ${banError.message}`);
|
||||
|
||||
// Performance threshold: 200ms for simple functions
|
||||
const threshold = 200;
|
||||
|
||||
Reference in New Issue
Block a user