MCPcopy Create free account
hub / github.com/astercloud/aster / TestNewApp

Function TestNewApp

pkg/desktop/desktop_test.go:13–58  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

11)
12
13func TestNewApp(t *testing.T) {
14 tests := []struct {
15 name string
16 cfg *AppConfig
17 wantFrame Framework
18 }{
19 {
20 name: "default config",
21 cfg: nil,
22 wantFrame: FrameworkWeb,
23 },
24 {
25 name: "wails framework",
26 cfg: &AppConfig{
27 Framework: FrameworkWails,
28 },
29 wantFrame: FrameworkWails,
30 },
31 {
32 name: "tauri framework",
33 cfg: &AppConfig{
34 Framework: FrameworkTauri,
35 },
36 wantFrame: FrameworkTauri,
37 },
38 {
39 name: "electron framework",
40 cfg: &AppConfig{
41 Framework: FrameworkElectron,
42 },
43 wantFrame: FrameworkElectron,
44 },
45 }
46
47 for _, tt := range tests {
48 t.Run(tt.name, func(t *testing.T) {
49 app, err := NewApp(tt.cfg)
50 if err != nil {
51 t.Fatalf("NewApp() error = %v", err)
52 }
53 if app.Bridge().Framework() != tt.wantFrame {
54 t.Errorf("Framework() = %v, want %v", app.Bridge().Framework(), tt.wantFrame)
55 }
56 })
57 }
58}
59
60func TestNewAppUnsupportedFramework(t *testing.T) {
61 _, err := NewApp(&AppConfig{

Callers

nothing calls this directly

Calls 4

BridgeMethod · 0.95
NewAppFunction · 0.85
FrameworkMethod · 0.65
RunMethod · 0.45

Tested by

no test coverage detected