tests/testthat/test_exception.R

context("Error message")

# This test fails with the CRAN custom clang toolchains.
# The test is automatically removed by the autobrew script
test_that("SyntaxError from V8", {
  ctx <- V8::v8()
  expect_error(ctx$eval('var foo = }bla}'), 'SyntaxError', class = "std::invalid_argument")
})

Try the V8 package in your browser

Any scripts or data that you put into this service are public.

V8 documentation built on Sept. 11, 2024, 8:06 p.m.