fix(compliance): improve compliance

This commit is contained in:
2025-05-27 12:23:50 +00:00
parent 206bef0619
commit be123e41c9
22 changed files with 725 additions and 793 deletions

View File

@ -3,6 +3,7 @@ import { promises as fs } from 'fs';
import * as path from 'path';
import { CorpusLoader } from '../../helpers/corpus.loader.js';
import { PerformanceTracker } from '../../helpers/performance.tracker.js';
import * as plugins from '../../../ts/plugins.js';
tap.test('VAL-01: XML Syntax Validation - should validate XML syntax of invoice files', async () => {
// Get XML test files from various categories
@ -32,7 +33,7 @@ tap.test('VAL-01: XML Syntax Validation - should validate XML syntax of invoice
async () => {
try {
// Use DOMParser to validate XML syntax
const parser = new DOMParser();
const parser = new plugins.DOMParser();
const doc = parser.parseFromString(xmlContent, 'application/xml');
// Check for parsing errors
@ -140,7 +141,7 @@ tap.test('VAL-01: XML Well-formedness - should validate XML well-formedness', as
'xml-wellformedness-check',
async () => {
try {
const parser = new DOMParser();
const parser = new plugins.DOMParser();
const doc = parser.parseFromString(testCase.xml, 'application/xml');
const parseError = doc.getElementsByTagName('parsererror');
@ -182,7 +183,7 @@ tap.test('VAL-01: XML Encoding Validation - should handle different encodings',
'xml-encoding-validation',
async () => {
try {
const parser = new DOMParser();
const parser = new plugins.DOMParser();
const doc = parser.parseFromString(test.xml, 'application/xml');
const parseError = doc.getElementsByTagName('parsererror');