fix(runtime): update test factories to include all required services
Add docs, ide, and module factories to runtime tests to match the expanded service requirements in newWithFactories. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
9ef000853e
commit
ce044759c1
1 changed files with 9 additions and 0 deletions
|
|
@ -9,8 +9,11 @@ import (
|
||||||
"github.com/Snider/Core/pkg/config"
|
"github.com/Snider/Core/pkg/config"
|
||||||
"github.com/Snider/Core/pkg/crypt"
|
"github.com/Snider/Core/pkg/crypt"
|
||||||
"github.com/Snider/Core/pkg/display"
|
"github.com/Snider/Core/pkg/display"
|
||||||
|
"github.com/Snider/Core/pkg/docs"
|
||||||
"github.com/Snider/Core/pkg/help"
|
"github.com/Snider/Core/pkg/help"
|
||||||
|
"github.com/Snider/Core/pkg/ide"
|
||||||
"github.com/Snider/Core/pkg/io"
|
"github.com/Snider/Core/pkg/io"
|
||||||
|
"github.com/Snider/Core/pkg/module"
|
||||||
"github.com/Snider/Core/pkg/workspace"
|
"github.com/Snider/Core/pkg/workspace"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -60,9 +63,12 @@ func TestNewServiceInitializationError(t *testing.T) {
|
||||||
factories := map[string]ServiceFactory{
|
factories := map[string]ServiceFactory{
|
||||||
"config": func() (any, error) { return config.New() },
|
"config": func() (any, error) { return config.New() },
|
||||||
"display": func() (any, error) { return display.New() },
|
"display": func() (any, error) { return display.New() },
|
||||||
|
"docs": func() (any, error) { return docs.New(docs.Options{BaseURL: "https://docs.lethean.io"}) },
|
||||||
"help": func() (any, error) { return help.New(help.Options{}) },
|
"help": func() (any, error) { return help.New(help.Options{}) },
|
||||||
"crypt": func() (any, error) { return crypt.New() },
|
"crypt": func() (any, error) { return crypt.New() },
|
||||||
"i18n": func() (any, error) { return nil, errors.New("i18n service failed to initialize") }, // This factory will fail
|
"i18n": func() (any, error) { return nil, errors.New("i18n service failed to initialize") }, // This factory will fail
|
||||||
|
"ide": func() (any, error) { return ide.New() },
|
||||||
|
"module": func() (any, error) { return module.NewService(module.Options{AppsDir: "apps"}) },
|
||||||
"workspace": func() (any, error) { return workspace.New(io.Local) },
|
"workspace": func() (any, error) { return workspace.New(io.Local) },
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -79,9 +85,12 @@ func TestMissingFactory(t *testing.T) {
|
||||||
factories := map[string]ServiceFactory{
|
factories := map[string]ServiceFactory{
|
||||||
// "config" intentionally missing
|
// "config" intentionally missing
|
||||||
"display": func() (any, error) { return display.New() },
|
"display": func() (any, error) { return display.New() },
|
||||||
|
"docs": func() (any, error) { return docs.New(docs.Options{BaseURL: "https://docs.lethean.io"}) },
|
||||||
"help": func() (any, error) { return help.New(help.Options{}) },
|
"help": func() (any, error) { return help.New(help.Options{}) },
|
||||||
"crypt": func() (any, error) { return crypt.New() },
|
"crypt": func() (any, error) { return crypt.New() },
|
||||||
"i18n": func() (any, error) { return nil, nil },
|
"i18n": func() (any, error) { return nil, nil },
|
||||||
|
"ide": func() (any, error) { return ide.New() },
|
||||||
|
"module": func() (any, error) { return module.NewService(module.Options{AppsDir: "apps"}) },
|
||||||
"workspace": func() (any, error) { return workspace.New(io.Local) },
|
"workspace": func() (any, error) { return workspace.New(io.Local) },
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue