Populates the supplied session variable for testing.
Arguments
- session
Shiny session variable (in app) or a list (outside of app)
- id
An ID string that corresponds with the ID used to call the modules UI elements
- id_ASM
An ID string that corresponds with the ID used to call the ASM module
- id_MB
An ID string that corresponds with the ID used to call the MB module
- full_session
Boolean to indicate if the full test session should be created (default
TRUE
).
Value
list with the following elements
isgood: Boolean indicating the exit status of the function.
session: The value Shiny session variable (in app) or a list (outside of app) after initialization.
input: The value of the shiny input at the end of the session initialization.
state: App state.
rsc: The
react_state
components.
Examples
# \donttest{
sess_res = CTS_test_mksession(session=list(), full_session=FALSE)
#> → MB: including file
#> → MB: source: file.path(system.file(package="onbrand"), "templates", "report.docx")
#> → MB: dest: file.path("config","report.docx")
#> → MB: including file
#> → MB: source: file.path(system.file(package="onbrand"), "templates", "report.pptx")
#> → MB: dest: file.path("config","report.pptx")
#> → MB: including file
#> → MB: source: file.path(system.file(package="onbrand"), "templates", "report.yaml")
#> → MB: dest: file.path("config","report.yaml")
#> ! MB: User-defined model: /Users/jmh/projects/ruminate/github/ruminate/docs/reference/user_model.R not found (skipping)
#> ! MB: User-defined model: /Users/jmh/projects/ruminate/github/ruminate/docs/reference/user_model.ctl not found (skipping)
#> → MB: module checksum updated:24933f86b657b9503f22440e8c4d3cac
#> → MB: State initialized
#> ! MB: User-defined model: /Users/jmh/projects/ruminate/github/ruminate/docs/reference/user_model.R not found (skipping)
#> ! MB: User-defined model: /Users/jmh/projects/ruminate/github/ruminate/docs/reference/user_model.ctl not found (skipping)
#>
#>
#> ℹ parameter labels from comments are typically ignored in non-interactive mode
#> ℹ Need to run with the source intact to parse comments
#> → MB: model checksum updated: cc37b764ee3c117dfce1f1d7bd0e6e12
#> → MB: module checksum updated:2ae8d3386b5fee38596e0104e04bc151
#> → CTS: including file
#> → CTS: source: file.path(system.file(package="onbrand"), "templates", "report.docx")
#> → CTS: dest: file.path("config","report.docx")
#> → CTS: including file
#> → CTS: source: file.path(system.file(package="onbrand"), "templates", "report.pptx")
#> → CTS: dest: file.path("config","report.pptx")
#> → CTS: including file
#> → CTS: source: file.path(system.file(package="onbrand"), "templates", "report.yaml")
#> → CTS: dest: file.path("config","report.yaml")
#> → CTS: source model change detected
#> → CTS: > covariates reset
#> → CTS: cohort checksum updated: 98890dc17c3d5a8008f5fd879ab1368c
#> → CTS: module checksum updated: 875396d76b918e9df1255e19976d2034
#> → CTS: State initialized
#> → CTS: add rule success
#> → CTS: rule added
#> → CTS: cohort checksum updated: 25e440c9ecc4b8058f7e8eedf9c8fa37
#> → CTS: module checksum updated: 7f4cc83ac02a009b6747a02b36bce9d7
#>
#>
#> using C compiler: ‘Apple clang version 15.0.0 (clang-1500.3.9.4)’
#> using SDK: ‘’
#>
#>
#> using C compiler: ‘Apple clang version 15.0.0 (clang-1500.3.9.4)’
#> using SDK: ‘’
#> Warning: multi-subject simulation without without 'omega'
#>
#>
#> Warning: multi-subject simulation without without 'omega'
#> → CTS: cohort checksum updated: 299e10ecd7da5e5b61a30c0a355e69f8
#> → CTS: module checksum updated: 61242dd11d225d71986e8e903e29da8c
# }