service/tests/tpl_test.go

21 lines
377 B
Go
Raw Normal View History

package service_test
import (
"strings"
"testing"
"apigo.cc/gojs"
_ "apigo.cc/gojs/service"
"github.com/ssgo/u"
)
func TestTpl(t *testing.T) {
r, err := gojs.RunFile("tpl.js")
if err != nil {
t.Fatal("test static failed, got error", err)
}
if !strings.Contains(u.String(r), "<h1>Welcome to <b>Abc</b></h1>") {
t.Fatal("test tpl failed, name not match", r)
}
}