plugins/tests/file_test.go
Star b6bb3098bc update dao
many other updates
2024-03-24 12:28:02 +08:00

28 lines
500 B
Go

package tests
import (
"apigo.cloud/git/apigo/gojs"
"apigo.cloud/git/apigo/plugin"
_ "apigo.cloud/git/apigo/plugins/file"
"testing"
)
func TestFile(t *testing.T) {
rt := gojs.New(nil)
defer rt.Close()
gojs.SetPluginsConfig(map[string]plugin.Config{
"apigo.cloud/git/apigo/plugins/file": {
"allowPaths": []string{
"testData",
},
"allowExtensions": []string{
".txt",
},
},
})
r, err := rt.RunFile("file_test.js")
Test(t, "file", r == true && err == nil, r, err)
}