Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upmoduleServer/testServer overhaul #2807
Conversation
b709b53
into
master
This PR aligns the feature formerly known as "integration testing" with the new
moduleServer()function and usage patterns.Changes
Previously, the integration testing feature consisted of two entrypoints:
testModule()andtestServer(). Now, there's only one entrypoint,testServer().testServer()can be used to test either the server functions in established Shiny apps, or module functions.In addition to the consolidation of these functions, there is a slight semantic change corresponding to the change in definition of a Shiny module. Previously, the environment captured from within module functions was used to mask the surrounding dynamic environment of the
testServer(). The combination of the module's dynamic environment mask and the environment surrounding the call totestServer()defined the environment in which theexprargument totestServer()was evaluated.Now, because "new-style" modules involve at least two functions -- and two environments of interest, with respect to testing -- these two function environments are combined, with the inner-most environment taking precedence. The new semantics are demonstrated in
tests/testthat/test-test-server-scope.R.