UNPKG

pcp-server-nodejs-sdk

Version:

[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=PAYONE-GmbH_PCP-server-nodeJS-SDK&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=PAYONE-GmbH_PCP-server-nodeJS-SDK) [![Coverage](https://sonarcloud.io/api/pr

18 lines 737 B
import { describe, test, expect } from 'vitest'; import { ApiException } from './ApiException.js'; describe('ApiException', () => { test('constructor', () => { const apiException = new ApiException(404, 'Body'); expect(apiException).toBeDefined(); }); test('constructor with cause', () => { const apiException = new ApiException(404, 'Body', new Error('Cause')); expect(apiException.stack).toContain('Error: Cause'); }); test('getters', () => { const apiException = new ApiException(404, 'Body'); expect(apiException.getResponseBody()).toEqual('Body'); expect(apiException.getStatusCode()).toEqual(404); }); }); //# sourceMappingURL=ApiException.test.js.map