https://github.com/CorradoLanera/autotestthat
Easily automate your test-driven development in R
https://github.com/CorradoLanera/autotestthat
Last synced: 5 months ago
JSON representation
Easily automate your test-driven development in R
- Host: GitHub
- URL: https://github.com/CorradoLanera/autotestthat
- Owner: CorradoLanera
- License: other
- Created: 2019-07-19T22:56:58.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-04-28T16:15:18.000Z (almost 5 years ago)
- Last Synced: 2024-08-13T07:11:36.055Z (8 months ago)
- Language: R
- Size: 49.8 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.Rmd
- Changelog: NEWS.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
- Support: .github/SUPPORT.md
Awesome Lists containing this project
- jimsghstars - CorradoLanera/autotestthat - Easily automate your test-driven development in R (R)
README
---
output: github_document
---```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# autotestthat[](https://ci.appveyor.com/project/CorradoLanera/autotestthat)
[](https://travis-ci.org/CorradoLanera/autotestthat)
[](https://codecov.io/gh/CorradoLanera/autotestthat?branch=master)
[](https://CRAN.R-project.org/package=autotestthat)
[](https://cranlogs.r-pkg.org/badges/grand-total/autotestthat)
[](https://www.tidyverse.org/lifecycle/#maturing)The goal of **autotestthat** is to provide a way to use
`testthat::auto_test_package()` functionality on
[RStudio](https://www.rstudio.com/), mantaining your R session free.## Installation
Shortly, you can surely install the released version of **autotestthat**
from [CRAN](https://CRAN.R-project.org) with:``` r
install.packages("autotestthat")
```I prefer to wait for some feedback and to use it for some more time
before to publish it on [CRAN](https://CRAN.R-project.org).In the meanwhile, you can install the development version from
[GitHub](https://github.com/) with the following procedure:```{r, eval = FALSE}
# install.packages("devtools")
devtools::install_github("CorradoLanera/autotestthat")
```## Example
The package does not provide quite any specific function to use from the
command line or in a script.Mainly you are only asked to attach it by
```{r example, eval=FALSE}
library(autotestthat)
```and next you can use the Addin `Continuously test package` from the
project-bar menu of [RStudio](https://www.rstudio.com/) (which is
required to be at least v.1.2).When you click on that option, an RStudio _Job_ is activated running the
`testthat::auto_test_package()` on the background. That's it.You can now maintain visible the _Job_ tab to see regularly and
automatically all your tests
_fail_!^[http://agiledata.org/essays/tdd.html] On top of that, you can
switch to the _console_ tab whenever you need, using R at your
convenience: your current r-session is there, free to receive codes to
run.The advantage of running an automated test continuously while you are
developing code is that you do not have to decide _when_ test your
package, and even _that_ you have to (/are) test(/ing) your package:
every time you create or modify a function, a test or a helper, all the
relevant test are automatically re-executed on an updated environment
emulating your one.## Additional notes
To stop the auto-testing job, you can use `stop_auto_test_job()`. On
the other hands, it does not work on the open-source version of RStudio.
If you are using the open-source version of RStudio, you can stop the
job by a click on the _stop_ button next to the job name in the main
_Jobs_ tab. Other possible ways to stop the job is to restart your main
R-session or close RStudio.## Disclaimer
I started this project, which is my first "public"/general-purposed one,
thanks to
[this](https://github.com/r-lib/testthat/pull/892#issuecomment-513226687)
advice. I hope I will be able to reach the expectations and to be of
some help for someone outside here.## Code of Conduct
Please note that the 'autotestthat' project is released with a
[Contributor Code of Conduct](.github/CODE_OF_CONDUCT.md). By
contributing to this project, you agree to abide by its terms.## Reference