Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shinytest and testthat in tandem #297

Closed
tyluRp opened this issue Dec 5, 2019 · 1 comment
Closed

Shinytest and testthat in tandem #297

tyluRp opened this issue Dec 5, 2019 · 1 comment

Comments

@tyluRp
Copy link

@tyluRp tyluRp commented Dec 5, 2019

I have a question about using shinytest and testthat together. How do I avoid two test outputs in the console? My current approach has a file run_tests.R in the root of my shiny project, it looks like this:

library(testthat)
library(shinytest)

test_that("Application Works", {
  expect_pass(testApp(".", compareImages = FALSE))
})

cat("\n\n")

test_file("tests/testthat/some-testthat-test.R")

This is kinda close but it looks like it's running two separate test logs. My log looks like:

==> Testing R file using 'testthat'

v |  OK F W S | Context
- |   1       | run_tests

v |  OK F W S | Context
v |   1       | test1
v |   1       | test2
v |   1       | test3

== Results ==========================================================================
Duration: 22.1 s

OK:       3
Failed:   0
Warnings: 0
Skipped:  0
v |   1       | run_tests [102.2 s]

== Results ==========================================================================
Duration: 103.1 s

OK:       1
Failed:   0
Warnings: 0
Skipped:  0

Test complete

But I would prefer it output something like:

==> Testing R file using 'testthat'

v |  OK F W S | Context
v |   1       | run_tests
v |   1       | test1
v |   1       | test2
v |   1       | test3

== Results ==========================================================================
Duration: 103.1 s

OK:       4
Failed:   0
Warnings: 0
Skipped:  0

Test complete

Any advice would be appreciated.

@tyluRp
Copy link
Author

@tyluRp tyluRp commented Dec 6, 2019

I've just decided to have two test scripts, one for shinytest and others for testthat.

@tyluRp tyluRp closed this Dec 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.