当我尝试在 test_dir 函数中定义路径时,它显示错误:
Error in UseMethod("xml_add_child") : no applicable method for 'xml_add_child' applied to an object of class "NULL"
Run Code Online (Sandbox Code Playgroud)
我的 testthat.R 文件有以下几行:
library(testthat)
library(package)
options(testthat.junit.output_file = "test-out.xml")
test_dir("tests/testthat/0_utils/", reporter = 'junit')
test_package("package")
Run Code Online (Sandbox Code Playgroud)
我的测试位于“tests/testthat/0_utils”文件夹中。我怎么解决这个问题?