Skip to content

Commit

Permalink
fix: add asset tests
Browse files Browse the repository at this point in the history
  • Loading branch information
n8maninger authored and alexfreska committed Apr 22, 2024
1 parent 2f48f69 commit 6915835
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 0 deletions.
30 changes: 30 additions & 0 deletions hostd/hostd_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package hostd

import (
"io/fs"
"testing"

"go.sia.tech/web/internal/nextjs"
)

func TestRouter(t *testing.T) {
err := fs.WalkDir(assets, ".", func(path string, d fs.DirEntry, err error) error {
if err != nil {
t.Fatal(err)
}
t.Log(path)
return nil
})
if err != nil {
t.Fatal(err)
}

assetFS, err := fs.Sub(assets, "assets")
if err != nil {
t.Fatal(err)
}
_, err = nextjs.NewRouter(assetFS.(fs.ReadDirFS))
if err != nil {
t.Fatal(err)
}
}
30 changes: 30 additions & 0 deletions renterd/renterd_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package renterd

import (
"io/fs"
"testing"

"go.sia.tech/web/internal/nextjs"
)

func TestRouter(t *testing.T) {
err := fs.WalkDir(assets, ".", func(path string, d fs.DirEntry, err error) error {
if err != nil {
t.Fatal(err)
}
t.Log(path)
return nil
})
if err != nil {
t.Fatal(err)
}

assetFS, err := fs.Sub(assets, "assets")
if err != nil {
t.Fatal(err)
}
_, err = nextjs.NewRouter(assetFS.(fs.ReadDirFS))
if err != nil {
t.Fatal(err)
}
}
30 changes: 30 additions & 0 deletions walletd/walletd_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package walletd

import (
"io/fs"
"testing"

"go.sia.tech/web/internal/nextjs"
)

func TestRouter(t *testing.T) {
err := fs.WalkDir(assets, ".", func(path string, d fs.DirEntry, err error) error {
if err != nil {
t.Fatal(err)
}
t.Log(path)
return nil
})
if err != nil {
t.Fatal(err)
}

assetFS, err := fs.Sub(assets, "assets")
if err != nil {
t.Fatal(err)
}
_, err = nextjs.NewRouter(assetFS.(fs.ReadDirFS))
if err != nil {
t.Fatal(err)
}
}

0 comments on commit 6915835

Please sign in to comment.