Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

231
Views
R/Shiny - Shinytest JS interpreter can not work with Promise and has old JS Standart

I want to use the R package shinytest to test my R/Shiny application. Now, I facing one strange issue after another. It seams that the JavaScript Interpreter of "shinytest" or which runs in the background can not work with Promise, neither simple things like 'a'.startsWith('a') does not work.

Can I switch the backend of shinytest or can I somehow add the missing JavaScript features?

In the following you see a minimal example, the app itself has no meaning, but the executing Javascript inside the test suite shows that simple calls fails.

To run the example you may need to install the "globals" package. Like renv::install("globals").

Example:

library(shiny)
library(shinytest)

# you may need to run: 
# renv::install("globals")


ui <- fluidPage(
  titlePanel("Hello Shiny!"),
  sidebarLayout(
    sidebarPanel(),
    mainPanel()
  )
)


# Define server logic required to draw a histogram ----
server <- function(input, output) {}


# See above for the definitions of ui and server
app <- shinyApp(ui = ui, server = server)

testapp <- ShinyDriver$new(app, debug="all")

testapp$executeScript("console.log('Hello')")
print(testapp$getDebugLog("browser"))
testapp$executeScript("console.log('a'.startsWith('b'))")
print(testapp$getDebugLog("browser"))
testapp$executeScript("console.log(Promise)")
print(testapp$getDebugLog("browser"))


The last print statements should always return correct output. But the error messages are:

B/I 12:26:40.26 Hello (:)> testapp$executeScript("console.log('a'.startsWith('b'))")
Error in session_makeRequest(self, private, endpoint, data, params, headers) : 
  undefined is not a function (evaluating ''a'.startsWith('b')')
> print(testapp$getDebugLog("browser"))
> testapp$executeScript("console.log(Promise)")
Error in session_makeRequest(self, private, endpoint, data, params, headers) : 
  Can't find variable: Promise

This means that Promises are not available in this shinytest package.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!