feat(encoder): Rename encoder class from ZugferdXmlEncoder to FacturXEncoder to better reflect Factur-X compliance. All related imports, exports, and tests have been updated while maintaining backward compatibility.
This commit is contained in:
11
test/test.ts
11
test/test.ts
@ -2,7 +2,7 @@ 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 { ZugferdXmlEncoder } from '../ts/classes.encoder.js';
|
||||
import { FacturXEncoder } from '../ts/classes.encoder.js';
|
||||
import { ZUGFeRDXmlDecoder } from '../ts/classes.decoder.js';
|
||||
|
||||
// Group 1: Basic functionality tests for XInvoice class
|
||||
@ -91,11 +91,12 @@ tap.test('XInvoice should correctly handle XML and LetterData', async () => {
|
||||
});
|
||||
|
||||
// Group 5: Basic encoder test
|
||||
tap.test('ZugferdXmlEncoder instance should be created', async () => {
|
||||
const encoder = new ZugferdXmlEncoder();
|
||||
tap.test('FacturXEncoder instance should be created', async () => {
|
||||
const encoder = new FacturXEncoder();
|
||||
expect(encoder).toBeTypeOf('object');
|
||||
// Testing the existence of the method without calling it
|
||||
expect(encoder.createZugferdXml).toBeTypeOf('function');
|
||||
// Testing the existence of methods without calling them
|
||||
expect(encoder.createFacturXXml).toBeTypeOf('function');
|
||||
expect(encoder.createZugferdXml).toBeTypeOf('function'); // For backward compatibility
|
||||
});
|
||||
|
||||
// Group 6: Basic decoder test
|
||||
|
Reference in New Issue
Block a user