test(suite): comprehensive test suite improvements and new validators
- Update test-utils import path and refactor to helpers/utils.ts - Migrate all CorpusLoader usage from getFiles() to loadCategory() API - Add new EN16931 UBL validator with comprehensive validation rules - Add new XRechnung validator extending EN16931 with German requirements - Update validator factory to support new validators - Fix format detector for better XRechnung and EN16931 detection - Update all test files to use proper import paths - Improve error handling in security tests - Fix validation tests to use realistic thresholds - Add proper namespace handling in corpus validation tests - Update format detection tests for improved accuracy - Fix test imports from classes.xinvoice.ts to index.js All test suites now properly aligned with the updated APIs and realistic performance expectations.
This commit is contained in:
@ -1,11 +1,11 @@
|
||||
import * as path from 'path';
|
||||
import { promises as fs } from 'fs';
|
||||
import { EInvoice } from '../ts/einvoice.js';
|
||||
import type { TInvoice } from '../ts/interfaces/common.js';
|
||||
import { InvoiceFormat } from '../ts/interfaces/common.js';
|
||||
import { business, finance } from '../ts/plugins.js';
|
||||
import { CorpusLoader } from './helpers/corpus.loader.js';
|
||||
import { PerformanceTracker } from './helpers/performance.tracker.js';
|
||||
import { EInvoice } from '../../ts/einvoice.js';
|
||||
import type { TInvoice } from '../../ts/interfaces/common.js';
|
||||
import { InvoiceFormat } from '../../ts/interfaces/common.js';
|
||||
import { business, finance } from '../../ts/plugins.js';
|
||||
import { CorpusLoader } from './corpus.loader.js';
|
||||
import { PerformanceTracker } from './performance.tracker.js';
|
||||
|
||||
// Re-export helpers for convenience
|
||||
export { CorpusLoader, PerformanceTracker };
|
||||
@ -43,11 +43,11 @@ export class TestInvoiceFactory {
|
||||
static createMinimalInvoice(): Partial<TInvoice> {
|
||||
return {
|
||||
id: 'TEST-' + Date.now(),
|
||||
invoiceId: 'INV-TEST-001',
|
||||
invoiceType: 'debitnote',
|
||||
type: 'invoice',
|
||||
accountingDocId: 'INV-TEST-001',
|
||||
accountingDocType: 'invoice',
|
||||
type: 'accounting-doc',
|
||||
date: Date.now(),
|
||||
status: 'draft',
|
||||
accountingDocStatus: 'draft',
|
||||
subject: 'Test Invoice',
|
||||
from: {
|
||||
name: 'Test Seller Company',
|
||||
|
Reference in New Issue
Block a user