create_unit_tests {chatgpt}R Documentation

ChatGPT: Create Unit Tests

Description

Create 'testthat' test cases for the code.

Usage

create_unit_tests(code = clipr::read_clip(allow_non_interactive = TRUE))

Arguments

code

The code for which to create unit tests by ChatGPT. If not provided, it will use what's copied on the clipboard.

Value

A character value with the response generated by ChatGPT.

Examples

## Not run: 
cat(create_unit_tests("squared_numbers <- function(numbers) {\n  numbers ^ 2\n}"))

## End(Not run)


[Package chatgpt version 0.2.3 Index]