test(e2e): add End-to-End test suite

Added comprehensive E2E tests:

1. API E2E Tests (api.e2e.test.ts):
   - Healthcheck API testing
   - Static resources verification
   - Module loading tests
   - Converter properties validation
   - File type normalization tests
   - i18n module tests
   - Transfer module tests
   - Database structure tests

2. Converter E2E Tests (converters.e2e.test.ts):
   - Real Inkscape conversions (SVG → PNG/PDF/EPS)
   - Real Pandoc conversions (Markdown → HTML/DOCX/RST)
   - Dasel format conversions (JSON → YAML/TOML)
   - Batch conversion tests
   - Error handling tests
   - Auto-detection of available tools

3. Test Infrastructure:
   - helpers.ts: Tool detection, test file generation
   - fixtures/: Sample test files (SVG, MD, JSON)
   - .gitignore: Exclude output directory

Total: 34 new E2E tests
This commit is contained in:
Your Name 2026-01-23 00:14:31 +08:00
parent 26304a295e
commit 840c215597
8 changed files with 1038 additions and 0 deletions

View file

@ -0,0 +1,29 @@
{
"name": "e2e-test-data",
"version": "1.0.0",
"description": "Test JSON file for E2E testing",
"metadata": {
"created": "2024-01-01T00:00:00Z",
"author": "E2E Test Suite"
},
"data": {
"items": [
{ "id": 1, "name": "Item One", "value": 100 },
{ "id": 2, "name": "Item Two", "value": 200 },
{ "id": 3, "name": "Item Three", "value": 300 }
],
"nested": {
"level1": {
"level2": {
"key": "deep-value"
}
}
},
"tags": ["test", "e2e", "conversion"]
},
"settings": {
"enabled": true,
"threshold": 0.75,
"options": ["a", "b", "c"]
}
}

View file

@ -0,0 +1,46 @@
# E2E Test Document
This is a test document for end-to-end testing of the ConvertX file conversion system.
## Introduction
ConvertX is a self-hosted file conversion tool that supports multiple formats.
## Features
- **Multiple Formats**: Support for images, documents, audio, video, and more
- **Self-Hosted**: Complete control over your data
- **i18n Support**: Available in 65+ languages
- **Chunk Transfer**: Efficient handling of large files
## Code Example
```python
def hello_world():
print("Hello, ConvertX!")
return True
```
## Table Example
| Format | Type | Converter |
|--------|------|-----------|
| SVG | Image | Inkscape |
| PDF | Document | LibreOffice |
| MP4 | Video | FFmpeg |
| DOCX | Document | Pandoc |
## List Example
1. Upload your file
2. Select the target format
3. Click convert
4. Download the result
## Conclusion
Thank you for using ConvertX!
---
*This document is used for E2E testing purposes.*

View file

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200" viewBox="0 0 200 200">
<!-- Background -->
<rect width="200" height="200" fill="#f0f0f0"/>
<!-- Main shape -->
<rect x="20" y="20" width="160" height="160" fill="#4285f4" rx="20"/>
<!-- Inner circle -->
<circle cx="100" cy="100" r="50" fill="#ffffff"/>
<!-- Cross lines -->
<line x1="100" y1="60" x2="100" y2="140" stroke="#4285f4" stroke-width="8"/>
<line x1="60" y1="100" x2="140" y2="100" stroke="#4285f4" stroke-width="8"/>
<!-- Text label -->
<text x="100" y="180" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" fill="#333">E2E Test</text>
</svg>

After

Width:  |  Height:  |  Size: 711 B