This commit is contained in:
2025-03-17 16:30:23 +00:00
parent bbc9b837f4
commit e929281861
20 changed files with 1777 additions and 381 deletions

View File

@ -2,8 +2,8 @@ import { tap, expect } from '@push.rocks/tapbundle';
import * as fs from 'fs/promises';
import * as xinvoice from '../ts/index.js';
import * as getInvoices from './assets/getasset.js';
import { FacturXEncoder } from '../ts/classes.encoder.js';
import { ZUGFeRDXmlDecoder } from '../ts/classes.decoder.js';
import { FacturXEncoder } from '../ts/formats/facturx.encoder.js';
import { FacturXDecoder } from '../ts/formats/facturx.decoder.js';
// Group 1: Basic functionality tests for XInvoice class
tap.test('XInvoice should initialize correctly', async () => {
@ -100,12 +100,12 @@ tap.test('FacturXEncoder instance should be created', async () => {
});
// Group 6: Basic decoder test
tap.test('ZUGFeRDXmlDecoder should be created correctly', async () => {
tap.test('FacturXDecoder should be created correctly', async () => {
// Create a simple XML to test with
const simpleXml = '<?xml version="1.0" encoding="UTF-8"?><test><name>Test Invoice</name></test>';
// Create decoder instance
const decoder = new ZUGFeRDXmlDecoder(simpleXml);
const decoder = new FacturXDecoder(simpleXml);
// Check that the decoder is created correctly
expect(decoder).toBeTypeOf('object');