Skip to contents

Tests a library's code or a specific update without permanently creating it. The behaviour depends on the arguments:

  • If only js_code is provided, tests that code as a new library.

  • If library and optionally updatename are given, tests the existing library's code (or a specific update).

Usage

mc_test_library(conn, library = NULL, updatename = NULL, js_code = NULL)

Arguments

conn

A connection object created by mc_connect.

library

Optional character string. Library name or transaction ID.

updatename

Optional character string. Update name (if testing an update).

js_code

Optional character string. JavaScript code (if testing a new library).

Value

The result of the test (e.g., compiled code, validation output).

Examples

if (FALSE) { # \dontrun{
# Test a new library
mc_test_library(conn, js_code = "function add(a, b) { return a + b; }")

# Test an existing library's active code
mc_test_library(conn, library = "math")
} # }