134 lines
3.3 KiB
HTML
134 lines
3.3 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>dgray.io - Tests</title>
|
|
<style>
|
|
:root {
|
|
--color-bg: #1a1a1a;
|
|
--color-text: #f0f0f0;
|
|
--color-passed: #4ade80;
|
|
--color-failed: #f87171;
|
|
--color-border: #333;
|
|
}
|
|
|
|
* {
|
|
box-sizing: border-box;
|
|
margin: 0;
|
|
padding: 0;
|
|
}
|
|
|
|
body {
|
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
background: var(--color-bg);
|
|
color: var(--color-text);
|
|
padding: 2rem;
|
|
line-height: 1.6;
|
|
}
|
|
|
|
h1 {
|
|
margin-bottom: 1rem;
|
|
font-size: 1.5rem;
|
|
}
|
|
|
|
h2 {
|
|
font-size: 1.2rem;
|
|
margin-bottom: 0.5rem;
|
|
}
|
|
|
|
.test-summary {
|
|
background: #222;
|
|
padding: 1rem;
|
|
border-radius: 8px;
|
|
margin-bottom: 1rem;
|
|
}
|
|
|
|
.test-summary .passed {
|
|
color: var(--color-passed);
|
|
}
|
|
|
|
.test-summary .failed {
|
|
color: var(--color-failed);
|
|
}
|
|
|
|
.test-list {
|
|
list-style: none;
|
|
}
|
|
|
|
.test-list li {
|
|
padding: 0.5rem 1rem;
|
|
border-bottom: 1px solid var(--color-border);
|
|
}
|
|
|
|
.test-list li.passed {
|
|
color: var(--color-passed);
|
|
}
|
|
|
|
.test-list li.failed {
|
|
color: var(--color-failed);
|
|
}
|
|
|
|
.test-list li small {
|
|
display: block;
|
|
color: #888;
|
|
font-family: monospace;
|
|
margin-top: 0.25rem;
|
|
}
|
|
|
|
#results {
|
|
max-width: 800px;
|
|
margin: 0 auto;
|
|
}
|
|
|
|
.loading {
|
|
color: #888;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div id="results">
|
|
<h1>🧪 dgray.io Test Suite</h1>
|
|
<p class="loading">Running tests...</p>
|
|
</div>
|
|
|
|
<script type="module">
|
|
import { renderResults, runAsyncTests } from './test-runner.js'
|
|
|
|
const container = document.getElementById('results')
|
|
|
|
// Run all test files
|
|
async function runTests() {
|
|
try {
|
|
// Sync tests
|
|
await import('./helpers.test.js')
|
|
await import('./i18n.test.js')
|
|
await import('./router.test.js')
|
|
|
|
// Service tests (sync + async)
|
|
await import('./client.test.js')
|
|
await import('./services.test.js')
|
|
await import('./crypto.test.js')
|
|
|
|
// Run queued async tests
|
|
await runAsyncTests()
|
|
|
|
// Clear loading message and render results
|
|
container.querySelector('.loading').remove()
|
|
renderResults(container)
|
|
} catch (error) {
|
|
container.innerHTML = `
|
|
<h1>🧪 dgray.io Test Suite</h1>
|
|
<p style="color: var(--color-failed)">
|
|
Error loading tests: ${error.message}
|
|
</p>
|
|
<pre style="color: #888; font-size: 0.8rem; margin-top: 1rem;">${error.stack}</pre>
|
|
`
|
|
}
|
|
}
|
|
|
|
runTests()
|
|
</script>
|
|
</body>
|
|
</html>
|