tests/testthat/test-welcomeMessage.R

test_that("welcome message is an html widget", {
  expect_s3_class(welcomeMessage(),'htmlwidget')
})


test_that("default welcome message holds certain keys",{
  output <- chat_message_default()

  # Define the expected keys
  expected_keys <- c("role", "content")

  # Check if all expected keys are present in the output list
  expect_true(all(expected_keys %in% names(output)))

  #check that role is assistant
  expect_true(output$role == 'assistant')
})

Try the mergenstudio package in your browser

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

mergenstudio documentation built on Sept. 11, 2024, 5:17 p.m.