Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mjfrigaard/mstsap
Mastering Shiny testServer() application package (demo)
https://github.com/mjfrigaard/mstsap
Last synced: 9 days ago
JSON representation
Mastering Shiny testServer() application package (demo)
- Host: GitHub
- URL: https://github.com/mjfrigaard/mstsap
- Owner: mjfrigaard
- License: other
- Created: 2023-06-26T16:45:01.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-01-20T19:40:55.000Z (11 months ago)
- Last Synced: 2024-08-13T07:11:08.365Z (4 months ago)
- Language: R
- Homepage: https://mjfrigaard.github.io/mstsap/
- Size: 4.96 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - mjfrigaard/mstsap - Mastering Shiny testServer() application package (demo) (R)
README
---
output: github_document
---```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```# `mstsap`
`mstsap` (Mastering shiny `testServer()` app-package) is a collection of tests using [`testthat`](https://testthat.r-lib.org/) and [`shiny::testServer()`](https://search.r-project.org/CRAN/refmans/shiny/html/testServer.html).
The modules and applications in `mstsap` come from the [Shiny modules chapter](https://mastering-shiny.org/scaling-modules.html) of [Mastering Shiny](https://mastering-shiny.org/index.html).
## Installation
You don't *have* to install the `mstsap` package, but you might want to download it as an example (or read through [this post](https://mjfrigaard.github.io/posts/test-shiny-p3/) to learn about it's contents).
```{r}
#| eval: false
install.packages("remotes")
remotes::install_github("mjfrigaard/mstsap")
library(mstsap)
```## Utility function tests
There is a single utility function in `mstsap`: `find_vars()`
```{r}
#| eval: true
#| echo: false
fs::dir_tree("tests/testthat/", regexp = "find")
``````{r}
#| eval: false
testthat::test_file("tests/testthat/test-find_vars.R")
``````{verbatim}
#> [ FAIL 0 | WARN 0 | SKIP 0 | PASS 4 ]
```## `testServer()` tests
```{r}
#| eval: true
#| echo: false
fs::dir_tree("tests/testthat/", regexp = "Server|App")
``````{verbatim}
🐝 Your tests are the bee's knees 🐝
```