Skip to content

Commit 4e392fb

Browse files
authored
Transform snapshot with variable output (#448)
1 parent 20be079 commit 4e392fb

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

tests/testthat/_snaps/session.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<session> https://hadley.nz/
88
Status: 200
99
Type: text/html; charset=utf-8
10-
Size: 20773
10+
Size: <size>
1111
Code
1212
expect_true(is.session(s))
1313
s <- session_follow_link(s, css = "p a")

tests/testthat/test-session.R

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ test_that("basic session process works as expected", {
66

77
s <- session_follow_link(s, css = "p a")
88
session_history(s)
9-
})
9+
}, transform = function(x) gsub("Size: .*", "Size: <size>", x))
1010
})
1111

1212
test_that("session caches xml parsing and sets base url", {
@@ -103,4 +103,3 @@ test_that("can submit a form", {
103103
resp <- httr::content(s$response)
104104
expect_equal(resp$query, "x=1&y=2")
105105
})
106-

0 commit comments

Comments
 (0)