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

Function TestRunJavascript_error

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

Source from the content-addressed store, hash-verified

20}
21
22func TestRunJavascript_error(t *testing.T) {
23 t.Parallel()
24 tool := &codeModeTool{}
25
26 result, err := tool.runJavascript(t.Context(), `==`)
27 require.NoError(t, err)
28
29 assert.Equal(t, "SyntaxError: SyntaxError: (anonymous): Line 2:1 Unexpected token == (and 2 more errors)", result.Value)
30 assert.Empty(t, result.StdOut)
31 assert.Empty(t, result.StdErr)
32}
33
34func TestRunJavascript_console(t *testing.T) {
35 t.Parallel()

Callers

nothing calls this directly

Calls 2

runJavascriptMethod · 0.95
ContextMethod · 0.80

Tested by

no test coverage detected