plugins/tests/file_test.go

28 lines
500 B
Go
Raw Normal View History

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) {
2024-03-24 12:28:02 +08:00
rt := gojs.New(nil)
defer rt.Close()
gojs.SetPluginsConfig(map[string]plugin.Config{
2024-03-24 12:28:02 +08:00
"apigo.cloud/git/apigo/plugins/file": {
"allowPaths": []string{
"testData",
},
"allowExtensions": []string{
".txt",
},
},
})
2024-03-24 12:28:02 +08:00
r, err := rt.RunFile("file_test.js")
Test(t, "file", r == true && err == nil, r, err)
}