mirror of
https://github.com/MontFerret/ferret.git
synced 2025-07-15 01:25:00 +02:00
Feature/pre compiled eval scripts (#658)
* Added support of pre-compiled eval expressions * Added unit tests for eval.Function * Added RemoteType and RemoteObjectType enums * Refactored function generation * Refactored Document and Element loading logic * Removed redundant fields from cdp.Page * Exposed eval.Runtime to external callers * Added new eval.RemoteValue interface
This commit is contained in:
@ -1,20 +1 @@
|
||||
package eval
|
||||
|
||||
import (
|
||||
. "github.com/smartystreets/goconvey/convey"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestWrapExp(t *testing.T) {
|
||||
Convey("wrapExp", t, func() {
|
||||
Convey("When a plain expression is passed", func() {
|
||||
exp := "return true"
|
||||
So(wrapExp(exp, 0), ShouldEqual, "() => {\n"+exp+"\n}")
|
||||
})
|
||||
|
||||
Convey("When a plain expression is passed with args > 0", func() {
|
||||
exp := "return true"
|
||||
So(wrapExp(exp, 3), ShouldEqual, "(arg1,arg2,arg3) => {\n"+exp+"\n}")
|
||||
})
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user