【发布时间】:2020-03-07 04:01:32
【问题描述】:
MarkLogic 单元测试框架中的test:assert-throws-error 函数支持匿名函数模式来测试带参数的 XQuery 函数:
test:assert-throws-error(function() {fn:concat("this", "that")})
参考:https://github.com/marklogic-community/marklogic-unit-test/issues/111
但我不确定如何对 JavaScript 函数做同样的事情:
assertThrowsError(() => 'this' + 'that')
会导致以下错误:
XDMP-AS: (err:XPTY0004) $function as xdmp:function -- 无效强制:function (), "/test/suites/my/test.sjs" as xdmp:function
谢谢!
【问题讨论】: