Golem run tests

From ThinkR-open/golem · View interactive version

Golem run tests is an AI agent skill from the GitHub repository ThinkR-open/golem. Run tests for a golem Shiny application. Triggers on: - "run the tests" - "test my golem app" - "run devtools test" Do not trigger on: - when the user is not working inside a golem app

How to use this skill

Skill file

Run Tests

You are helping a user run tests for their golem Shiny application.

Running Tests

Run the following command to execute all tests:

Rscript -e "devtools::test()"

Testing Structure

Tests are organized in tests/testthat/:

Test Best Practices

Hermetic Tests

Temporary State

Test Data

Testing Reactive Code

Assertions

Use testthat functions:

Skipping Tests

For slow or network-dependent tests:

test_that("slow test", {
  skip_on_cran()
  # test code
})

Test Coverage

Aim for high code coverage:

Command Line Options

Run specific test files:

Rscript -e "devtools::test(filter = 'mod_name')"

Run tests with coverage:

Rscript -e "covr::report()"
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.