MCPcopy
hub / github.com/docker/docker-agent / TestRunJavascript

Function TestRunJavascript

pkg/tools/codemode/exec_test.go:10–20  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

8)
9
10func TestRunJavascript(t *testing.T) {
11 t.Parallel()
12 tool := &codeModeTool{}
13
14 result, err := tool.runJavascript(t.Context(), `return "HELLO"`)
15 require.NoError(t, err)
16
17 assert.Equal(t, "HELLO", result.Value)
18 assert.Empty(t, result.StdOut)
19 assert.Empty(t, result.StdErr)
20}
21
22func TestRunJavascript_error(t *testing.T) {
23 t.Parallel()

Callers

nothing calls this directly

Calls 2

runJavascriptMethod · 0.95
ContextMethod · 0.80

Tested by

no test coverage detected