initializeTestthatAddin: Initializes 'test_that()' call

View source: R/initialize_test_that_addin.R

initializeTestthatAddinR Documentation

Initializes test_that() call

Description

\Sexpr[results=rd, stage=render]{lifecycle::badge("experimental")}

Inserts code for calling testthat::test_that().

See `Details` for how to set a key command.

Usage

initializeTestthatAddin(insert = TRUE, indentation = NULL)

Arguments

insert

Whether to insert the code via rstudioapi::insertText() or return it. (Logical)

N.B. Mainly intended for testing the addin programmatically.

indentation

Indentation of the code. (Numeric)

N.B. Mainly intended for testing the addin programmatically.

Details

How to set up a key command in RStudio

After installing the package. Go to:

Tools >> Addins >> Browse Addins >> Keyboard Shortcuts.

Find "Initialize test_that()" and press its field under Shortcut.

Press desired key command, e.g. Alt+T.

Press Apply.

Press Execute.

Value

Inserts code for calling testthat::test_that().

Returns NULL invisibly.

Author(s)

Ludvig Renbo Olsen, r-pkgs@ludvigolsen.dk

See Also

Other addins: assertCollectionAddin(), dputSelectedAddin(), initializeGXSFunctionAddin(), insertExpectationsAddin(), navigateTestFileAddin(), wrapStringAddin()


xpectr documentation built on April 12, 2025, 2:12 a.m.