yao/service/watch_test.go
Max fabced291c fix: Enhance loading functions to handle non-existent directories
- Added checks in various loading functions to ignore processing if the respective directories do not exist, improving error handling and preventing unnecessary operations.
- Updated the Load function signature to return warnings alongside errors, allowing for better feedback on loading issues across different components.
2025-05-13 09:10:10 +08:00

31 lines
453 B
Go

package service
import (
"testing"
"time"
"github.com/yaoapp/yao/config"
"github.com/yaoapp/yao/engine"
)
func TestWatch(t *testing.T) {
_, err := engine.Load(config.Conf, engine.LoadOption{})
if err != nil {
t.Fatal(err)
}
srv, err := Start(config.Conf)
if err != nil {
t.Fatal(err)
}
defer Stop(srv)
done := make(chan uint8, 1)
go Watch(srv, done)
select {
case <-time.After(200 * time.Millisecond):
done <- 1
return
}
}