1
0
forked from rosa/hakurei

18 Commits

Author SHA1 Message Date
Kat
b88a20a811 TODO: actually write tests lol 2026-03-23 19:51:52 +11:00
Kat
e0b1f801b1 TODO: relocate test code 2026-03-23 19:51:52 +11:00
Kat
5f4231514d cmd/pkgserver: aria-describe test node summary with state
The summary marker does not appear in the AOM, so setting its alt text
is fruitless.
2026-03-23 19:51:52 +11:00
Kat
7e5e754e04 cmd/pkgserver: provide role descriptions for test nodes in web UI 2026-03-23 19:51:51 +11:00
Kat
cbde1bc8dd cmd/pkgserver: fix dark mode in test web UI 2026-03-23 19:51:51 +11:00
Kat
33aae4039b cmd/pkgserver: serialize JS enums as ints instead of strings 2026-03-23 19:51:51 +11:00
Kat
6b7a629031 cmd/pkgserver: set exit code when running JS tests from CLI 2026-03-23 19:51:51 +11:00
Kat
eb13240416 cmd/pkgserver: expose verbose StreamReporter flag via CLI 2026-03-23 19:51:51 +11:00
Kat
1aeebc13b2 cmd/pkgserver: implement skipping JS tests from the DSL 2026-03-23 19:51:51 +11:00
Kat
40667add60 cmd/pkgserver: allow non-global JS test suites 2026-03-23 19:51:51 +11:00
Kat
1074ffdc01 cmd/pkgserver: serialize raw log list for go test consumption 2026-03-23 19:51:51 +11:00
Kat
74ea7da79f cmd/pkgserver: add JSON reporter to facilitate go test integration 2026-03-23 19:51:51 +11:00
Kat
dfd791b71e cmd/pkgserver: fix multi-line JS test output display 2026-03-23 19:51:51 +11:00
Kat
5643751069 cmd/pkgserver: implement JS test DSL and runner 2026-03-23 19:51:51 +11:00
Kat
c5350601ef cmd/pkgserver: move StreamReporter display() to Reporter interface 2026-03-23 19:51:51 +11:00
Kat
4c051b082f cmd/pkgserver: add DOM reporter for JS tests 2026-03-23 19:51:51 +11:00
Kat
77a597fc44 cmd/pkgserver: add basic CLI reporter for testing JS 2026-03-23 19:51:51 +11:00
Kat
82060ac154 cmd/pkgserver: enable TypeScript's strict mode 2026-03-23 19:51:51 +11:00
19 changed files with 18 additions and 31 deletions

4
.gitignore vendored
View File

@@ -31,6 +31,10 @@ go.work.sum
/cmd/pkgserver/ui/static/*.js /cmd/pkgserver/ui/static/*.js
/cmd/pkgserver/ui/static/*.css* /cmd/pkgserver/ui/static/*.css*
/cmd/pkgserver/ui/static/*.css.map /cmd/pkgserver/ui/static/*.css.map
/cmd/pkgserver/ui_test/*.js
/cmd/pkgserver/ui_test/lib/*.js
/cmd/pkgserver/ui_test/lib/*.css*
/cmd/pkgserver/ui_test/lib/*.css.map
/internal/pkg/testdata/testtool /internal/pkg/testdata/testtool
/internal/rosa/hakurei_current.tar.gz /internal/rosa/hakurei_current.tar.gz

View File

@@ -25,38 +25,14 @@ func serveStaticContent(w http.ResponseWriter, r *http.Request) {
http.ServeFileFS(w, r, content, "ui/static/favicon.ico") http.ServeFileFS(w, r, content, "ui/static/favicon.ico")
case "/static/index.js": case "/static/index.js":
http.ServeFileFS(w, r, content, "ui/static/index.js") http.ServeFileFS(w, r, content, "ui/static/index.js")
case "/static/test.js":
http.ServeFileFS(w, r, content, "ui/static/test.js")
case "/static/test.css":
http.ServeFileFS(w, r, content, "ui/static/test.css")
case "/static/all_tests.js":
http.ServeFileFS(w, r, content, "ui/static/all_tests.js")
case "/static/test_tests.js":
http.ServeFileFS(w, r, content, "ui/static/test_tests.js")
case "/static/success-closed.svg":
http.ServeFileFS(w, r, content, "ui/static/success-closed.svg")
case "/static/success-open.svg":
http.ServeFileFS(w, r, content, "ui/static/success-open.svg")
case "/static/failure-closed.svg":
http.ServeFileFS(w, r, content, "ui/static/failure-closed.svg")
case "/static/failure-open.svg":
http.ServeFileFS(w, r, content, "ui/static/failure-open.svg")
case "/static/skip-closed.svg":
http.ServeFileFS(w, r, content, "ui/static/skip-closed.svg")
case "/static/skip-open.svg":
http.ServeFileFS(w, r, content, "ui/static/skip-open.svg")
default: default:
http.NotFound(w, r) http.NotFound(w, r)
} }
} }
func serveTester(w http.ResponseWriter, r *http.Request) {
http.ServeFileFS(w, r, content, "ui/test.html")
}
func uiRoutes(mux *http.ServeMux) { func uiRoutes(mux *http.ServeMux) {
mux.HandleFunc("GET /{$}", serveWebUI) mux.HandleFunc("GET /{$}", serveWebUI)
mux.HandleFunc("GET /favicon.ico", serveStaticContent) mux.HandleFunc("GET /favicon.ico", serveStaticContent)
mux.HandleFunc("GET /static/", serveStaticContent) mux.HandleFunc("GET /static/", serveStaticContent)
mux.HandleFunc("GET /test.html", serveTester)
} }

View File

@@ -158,4 +158,4 @@ document.addEventListener("DOMContentLoaded", () => {
assertGetElementById("sort").addEventListener("change", (event) => { assertGetElementById("sort").addEventListener("change", (event) => {
STATE.setSortOrder(parseInt((event.target as HTMLSelectElement).value)) STATE.setSortOrder(parseInt((event.target as HTMLSelectElement).value))
}) })
}) })

View File

@@ -3,4 +3,4 @@
"strict": true, "strict": true,
"target": "ES2024" "target": "ES2024"
} }
} }

View File

@@ -4,6 +4,6 @@ package main
import "embed" import "embed"
//go:generate sh -c "sass ui/static/dark.scss ui/static/dark.css && sass ui/static/light.scss ui/static/light.css && sass ui/static/test.scss ui/static/test.css && tsc -p ui/static" //go:generate sh -c "sass ui/static/dark.scss ui/static/dark.css && sass ui/static/light.scss ui/static/light.css && tsc -p ui/static"
//go:embed ui/* //go:embed ui/*
var content embed.FS var content embed.FS

View File

@@ -4,7 +4,7 @@
// provides faster iteration, especially for those acclimated to test-driven // provides faster iteration, especially for those acclimated to test-driven
// development. // development.
import "./all_tests.js"; import "../all_tests.js";
import { StreamReporter, TESTS } from "./test.js"; import { StreamReporter, TESTS } from "./test.js";
// TypeScript doesn't like process and Deno as their type definitions aren't // TypeScript doesn't like process and Deno as their type definitions aren't

View File

Before

Width:  |  Height:  |  Size: 788 B

After

Width:  |  Height:  |  Size: 788 B

View File

@@ -1,3 +1,3 @@
import "./all_tests.js"; import "../all_tests.js";
import { GoTestReporter, TESTS } from "./test.js"; import { GoTestReporter, TESTS } from "./test.js";
TESTS.run(new GoTestReporter()); TESTS.run(new GoTestReporter());

View File

Before

Width:  |  Height:  |  Size: 812 B

After

Width:  |  Height:  |  Size: 812 B

View File

Before

Width:  |  Height:  |  Size: 812 B

After

Width:  |  Height:  |  Size: 812 B

View File

Before

Width:  |  Height:  |  Size: 572 B

After

Width:  |  Height:  |  Size: 572 B

View File

Before

Width:  |  Height:  |  Size: 572 B

After

Width:  |  Height:  |  Size: 572 B

View File

@@ -3,7 +3,7 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="static/test.css"> <link rel="stylesheet" href="static/style.css">
<title>PkgServer Tests</title> <title>PkgServer Tests</title>
</head> </head>
<body> <body>

View File

@@ -1,4 +1,5 @@
import { NoOpReporter, TestRegistrar, context, group, suite, test } from "./test.js"; import "../ui/static/index.js"
import { NoOpReporter, TestRegistrar, context, group, suite, test } from "./lib/test.js";
suite("dog", [ suite("dog", [
group("tail", [ group("tail", [

View File

@@ -0,0 +1,6 @@
{
"compilerOptions": {
"strict": true,
"target": "ES2024"
}
}