How anmaso/prometheus-unit-test-helper works
Project type and purpose
• This is a single‐page application (SPA) built with Vue 3 that runs entirely in the browser.
File structure
• Top level:
• index.html – the entry point, includes Vue template and ESM script imports
• css/styles.css – all styling (Grafana‐like dark theme, responsive)
• js/
– utils.js: core data‐series parsing & calculation utilities
– chart-component.js: Vue component wrapping Chart.js instance
– chart-plugins.js: custom Chart.js plugins (e.g., highlight alerts)
– app.js: bootstraps Vue app, wires user inputs → charts → localStorage
– tests.js: shared unit tests for browser & Node
• node-run-tests.mjs – Node script to run the same tests headlessly
• package.json – ESM modules, npm scripts (start, test:node)
• Dockerfile – container to host the static SPA or run CI tests
README for additional insights
• No backend: served as static assets (index.html + CSS + JS).
• Dependencies loaded via CDN: Vue 3, Chart.js, chartjs-plugin-zoom.
• Optional local server (npm run start) or direct file:/// open.
• Tests can run in browser (?test=true) or in Node (npm run test:node).
• Configuration persisted in browser localStorage.