yao/share/watch_test.go
2022-02-09 00:49:57 +08:00

22 lines
358 B
Go

package share
import (
"log"
"os"
"path"
"testing"
"time"
"github.com/stretchr/testify/assert"
)
func TestWatch(t *testing.T) {
root := path.Join(os.Getenv("YAO_DEV"), "/tests/flows")
assert.NotPanics(t, func() {
go Watch(root, func(op string, file string) {
log.Println(op, file)
})
time.Sleep(time.Second * 2)
defer StopWatch()
})
}