MCPcopy Create free account
hub / github.com/driangle/taskmd / mockStaticFS

Function mockStaticFS

apps/cli/internal/web/export_test.go:13–39  ·  view source on GitHub ↗

mockStaticFS creates a minimal embedded FS for testing.

()

Source from the content-addressed store, hash-verified

11
12// mockStaticFS creates a minimal embedded FS for testing.
13func mockStaticFS() fstest.MapFS {
14 return fstest.MapFS{
15 "static/dist/index.html": &fstest.MapFile{
16 Data: []byte(`<!DOCTYPE html>
17<html>
18<head>
19 <meta charset="UTF-8">
20 <title>taskmd</title>
21 <script type="module" crossorigin src="/assets/index-abc123.js"></script>
22 <link rel="stylesheet" crossorigin href="/assets/index-abc123.css">
23</head>
24<body>
25 <div id="root"></div>
26</body>
27</html>`),
28 },
29 "static/dist/assets/index-abc123.js": &fstest.MapFile{
30 Data: []byte(`console.log("app")`),
31 },
32 "static/dist/assets/index-abc123.css": &fstest.MapFile{
33 Data: []byte(`body { margin: 0; }`),
34 },
35 "static/dist/favicon.ico": &fstest.MapFile{
36 Data: []byte("icon"),
37 },
38 }
39}
40
41// exportWithMockFS runs Export after temporarily replacing StaticFiles.
42// Since StaticFiles() returns an empty FS in non-embed builds, we

Callers 1

exportWithMockFSFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected