Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

239
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda