create_unit_tests: ChatGPT: Create Unit Tests

View source: R/create_unit_tests.R

create_unit_testsR 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)


chatgpt documentation built on May 31, 2023, 6:54 p.m.