Files
fx-serverless/hook/hook_test.go
2020-02-11 20:26:46 +08:00

22 lines
400 B
Go

package hook
import (
"testing"
)
func TestHook(t *testing.T) {
t.Run("text", func(t *testing.T) {
h := New("before_build", "npm install leftpad", "fixture")
if err := h.Run("fixture"); err != nil {
t.Fatal(err)
}
})
t.Run("script", func(t *testing.T) {
h := New("before_build", ".hooks/before_build", "fixture")
if err := h.Run("fixture"); err != nil {
t.Fatal(err)
}
})
}