🧪 [testing improvement] Cover remaining docxXmlText.ts functions - #137
🧪 [testing improvement] Cover remaining docxXmlText.ts functions#137MarsLuay wants to merge 1 commit into
Conversation
Added a dynamic loader `loadDocxXmlTextModule` in `tests/helpers/load-plugin-modules.mjs` and completely covered all functions inside `docxXmlText.ts` with tests inside `tests/docx-xml-text.test.mjs`.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
🎯 What: The testing gap addressed
The file
src/docxXmlText.tsonly had basic unit tests statically importing and testing thedecodeDocxXmlEntitiesfunction. The remaining three functions (normalizeDocxExtractedText,extractDocxTextFromXml, andextractDocxRunText) had no unit tests. Additionally, the existing test was statically importing.tsfiles rather than dynamically loading them via the testing harness esbuild loaders.📊 Coverage: What scenarios are now tested
loadDocxXmlTextModuleintests/helpers/load-plugin-modules.mjs.tests/docx-xml-text.test.mjsto dynamically loaddocxXmlText.ts.normalizeDocxExtractedTextconfirming correct normalization of line endings, tab spaces, and whitespace trimming.extractDocxTextFromXmlconfirming regex tag identification (<w:t>,<w:tab/>,<w:br/>), correct decoding, and text aggregation inside<w:p>blocks.extractDocxRunTextconfirming regex run identification without the post-processing normalization routines.✨ Result: The improvement in test coverage
src/docxXmlText.tsis fully tested with high confidence, and now properly utilizes dynamic module loaders according to the project conventions.PR created automatically by Jules for task 10710295744033958077 started by @MarsLuay