feat(tests): fully implemented test suite

This commit is contained in:
2025-05-26 05:16:32 +00:00
parent 1d52ce1211
commit 113ae22c42
40 changed files with 3747 additions and 37 deletions

View File

@ -1,4 +1,4 @@
import { tap, expect } from '@push.rocks/tapbundle';
import { tap, expect } from '@git.zone/tstest/tapbundle';
import {
EInvoice,
EInvoiceError,
@ -55,7 +55,7 @@ tap.test('Error Handling - XML recovery for common issues', async () => {
const bomError = new EInvoiceParsingError('BOM detected', { xmlSnippet: xmlWithBOM.substring(0, 50) });
const bomRecovery = await ErrorRecovery.attemptXMLRecovery(xmlWithBOM, bomError);
expect(bomRecovery.success).toBeTruthy();
expect(bomRecovery.success).toBeTrue();
expect(bomRecovery.cleanedXml).toBeTruthy();
expect(bomRecovery.cleanedXml!.charCodeAt(0)).not.toEqual(0xFEFF);
console.log('✓ BOM removal recovery successful');
@ -65,7 +65,7 @@ tap.test('Error Handling - XML recovery for common issues', async () => {
const ampError = new EInvoiceParsingError('Unescaped ampersand', {});
const ampRecovery = await ErrorRecovery.attemptXMLRecovery(xmlWithAmpersand, ampError);
expect(ampRecovery.success).toBeTruthy();
expect(ampRecovery.success).toBeTrue();
if (ampRecovery.cleanedXml) {
expect(ampRecovery.cleanedXml).toInclude('&');
console.log('✓ Ampersand escaping recovery successful');