forked from rosa/hakurei
cmd/pkgserver/ui_test: add DOM reporter
This commit is contained in:
@@ -2,4 +2,26 @@
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"embed"
|
||||
"io/fs"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
//go:generate tsc --outDir ui_test/static -p ui_test
|
||||
//go:generate sass ui_test/lib/ui.scss ui_test/static/style.css
|
||||
//go:generate cp ui_test/lib/ui.html ui_test/static/index.html
|
||||
//go:embed ui_test/static
|
||||
var _staticTest embed.FS
|
||||
|
||||
var staticTest = func() fs.FS {
|
||||
if f, err := fs.Sub(_staticTest, "ui_test/static"); err != nil {
|
||||
panic(err)
|
||||
} else {
|
||||
return f
|
||||
}
|
||||
}()
|
||||
|
||||
func testUIRoutes(mux *http.ServeMux) {
|
||||
mux.Handle("GET /test/", http.StripPrefix("/test", http.FileServer(http.FS(staticTest))))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user