MCPcopy Create free account
hub / github.com/dop251/goja / testScriptWithTestLibX

Method testScriptWithTestLibX

compiler_test.go:215–227  ·  view source on GitHub ↗
(script string, expectedResult Value, t *testing.T)

Source from the content-addressed store, hash-verified

213}
214
215func (r *Runtime) testScriptWithTestLibX(script string, expectedResult Value, t *testing.T) {
216 _, err := r.RunProgram(testLib())
217 if err != nil {
218 t.Fatal(err)
219 }
220
221 _, err = r.RunProgram(testLibX())
222 if err != nil {
223 t.Fatal(err)
224 }
225
226 r.testScript(script, expectedResult, t)
227}
228
229func (r *Runtime) testScript(script string, expectedResult Value, t *testing.T) {
230 r.testPrg(MustCompile("test.js", script, false), expectedResult, t)

Calls 4

RunProgramMethod · 0.95
testScriptMethod · 0.95
testLibFunction · 0.85
testLibXFunction · 0.85

Tested by

no test coverage detected