31 lines
581 B
Go
31 lines
581 B
Go
|
package office_test
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
"testing"
|
||
|
|
||
|
"apigo.cc/gojs"
|
||
|
_ "apigo.cc/gojs/console"
|
||
|
_ "apigo.cc/gojs/file"
|
||
|
_ "apigo.cc/gojs/office"
|
||
|
"github.com/ssgo/u"
|
||
|
)
|
||
|
|
||
|
func testJS(name string, t *testing.T) {
|
||
|
r, err := gojs.RunFile(name + "_test.js")
|
||
|
if err != nil {
|
||
|
t.Fatal(u.BRed("test "+name+" error"), err)
|
||
|
} else if r != true {
|
||
|
t.Fatal(u.BRed("test "+name+" failed"), r)
|
||
|
} else {
|
||
|
fmt.Println(u.BGreen("test " + name + " succeess"))
|
||
|
}
|
||
|
}
|
||
|
|
||
|
func TestOffice(t *testing.T) {
|
||
|
gojs.ExportForDev()
|
||
|
// gojs.WatchRun("excel_test.js")
|
||
|
// gojs.WaitAll()
|
||
|
testJS("excel", t)
|
||
|
}
|