Skip to content

Commit

Permalink
Fix #24
Browse files Browse the repository at this point in the history
  • Loading branch information
egnor committed Aug 11, 2023
1 parent b4d0767 commit b05048b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 3 additions & 4 deletions R/core.R
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,17 @@ configure_sentry <- function(dsn, app_name = NULL, app_version = NULL,

dsn_vars <- parse_dsn(dsn)

user_vars <- list(
skeleton <- list(
environment = environment,
contexts = list(
app = list(
app_name = app_name,
app_version = app_version
)
),
...
)
)

.sentry_env$payload_skeleton <- user_vars
.sentry_env$payload_skeleton <- utils::modifyList(skeleton, list(...))

invisible(list2env(dsn_vars, .sentry_env))
}
Expand Down
4 changes: 3 additions & 1 deletion tests/testthat/test-sentry.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,12 @@ test_that("setting configuration works", {

configure_sentry(dsn = "https://[email protected]/1",
app_name = "el appo", app_version = "8.8.8",
environment = "production")
environment = "production",
contexts = list(app = list(app_identifier = "APPO")))

expect_equal(.sentry_env$payload_skeleton$contexts$app$app_name, "el appo")
expect_equal(.sentry_env$payload_skeleton$contexts$app$app_version, "8.8.8")
expect_equal(.sentry_env$payload_skeleton$contexts$app$app_identifier, "APPO")
expect_equal(.sentry_env$payload_skeleton$environment, "production")
expect_equal(.sentry_env$dsn, "https://[email protected]/1")
expect_equal(.sentry_env$protocol, "https")
Expand Down

0 comments on commit b05048b

Please sign in to comment.