Spaces:
No application file
No application file
Download src/utils/apiLogger.test.ts from usrrootkali/Awakened_RiShre: direct link, hf CLI and curl.
- Browser
- Download file 828 Bytes
-
https://huggingface.co/spaces/usrrootkali/Awakened_RiShre/resolve/main/src/utils/apiLogger.test.ts
- Command line
-
hf download hf://spaces/usrrootkali/Awakened_RiShre/src/utils/apiLogger.test.ts
-
curl -L -o apiLogger.test.ts https://huggingface.co/spaces/usrrootkali/Awakened_RiShre/resolve/main/src/utils/apiLogger.test.ts
828 Bytes
| import test from 'node:test'; | |
| import assert from 'node:assert/strict'; | |
| import { logRealConsoleApiError } from './apiLogger.ts'; | |
| test('logRealConsoleApiError executes and outputs formatted error diagnostic', () => { | |
| let loggedError = false; | |
| const originalError = console.error; | |
| console.error = (...args) => { | |
| loggedError = true; | |
| }; | |
| try { | |
| logRealConsoleApiError({ | |
| topic: 'Test API Error Topic', | |
| endpoint: 'https://router.huggingface.co/hf-inference/v1/chat/completions', | |
| model: 'mistralai/Devstral-2-123B-Instruct-2512', | |
| status: 401, | |
| statusText: 'Unauthorized', | |
| message: 'Invalid access token provided', | |
| rawResponse: '{"error": "Authorization header is invalid"}', | |
| }); | |
| assert.equal(loggedError, true); | |
| } finally { | |
| console.error = originalError; | |
| } | |
| }); | |