Skip to content

Commit f009145

Browse files
committed
chore: migrate to vite as dev server and add unit tests
- Introduce Vite as the development server and build tool. - Update HTML to load scripts as ES modules. - Add Jest unit tests for script.js and achieve 100% coverage. - Add JSDoc comments to script.js. - Clean up unused python scripts and fix CSS syntax error.
1 parent f0adb2b commit f009145

12 files changed

Lines changed: 6011 additions & 46 deletions

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,6 @@ __pycache__/
2525
openapi.svg
2626
cdd-web-ui/assets/wasm/
2727
cdd-web-ui/browser/
28+
node_modules/
29+
dist/
30+
coverage/

ecosystem.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,6 @@ <h3 id="popover-title" class="popover-title">Consulting Services</h3>
178178
</div>
179179
</div>
180180
</footer>
181-
<script src="script.js"></script>
181+
<script type="module" src="/script.js"></script>
182182
</body>
183183
</html>

fix_svg_text.py

Lines changed: 0 additions & 20 deletions
This file was deleted.

fix_svg_text_inline.py

Lines changed: 0 additions & 13 deletions
This file was deleted.

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,6 @@ <h3 id="popover-title" class="popover-title">Consulting Services</h3>
308308
</div>
309309
</div>
310310
</footer>
311-
<script src="script.js"></script>
311+
<script type="module" src="/script.js"></script>
312312
</body>
313313
</html>

jest.config.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
module.exports = {
2+
testEnvironment: 'jsdom',
3+
collectCoverage: true,
4+
collectCoverageFrom: ['script.js'],
5+
coverageThreshold: {
6+
global: {
7+
branches: 100,
8+
functions: 100,
9+
lines: 100,
10+
statements: 100
11+
}
12+
}
13+
};

0 commit comments

Comments
 (0)