gen_tests | R Documentation |
Generates unit test code for an R function using the Gemini AI model.
gen_tests(prompt = NULL)
prompt |
A character string specifying additional instructions for the Gemini model. If NULL, a default prompt requesting unit tests is used. |
Invisibly returns the generated test code, but primarily inserts it into the RStudio console.
## Not run:
# Select your function code in the editor, then run:
gen_tests()
# For custom instructions:
gen_tests("Generate comprehensive testthat tests with edge cases")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.