Skip to content

Commit 3dc79c4

Browse files
committed
Test snapshots in describe/it
1 parent 7eb22e8 commit 3dc79c4

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

tests/testthat/_snaps/describe.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# snapshot tests in describe
2+
3+
Code
4+
1 + 1
5+
Output
6+
[1] 2
7+
8+
# snapshot tests in describe / and in it
9+
10+
Code
11+
1 + 1
12+
Output
13+
[1] 2
14+
115
# has to have a valid description for the block
216

317
Code

tests/testthat/test-describe.R

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,17 @@ describe("describe", {
1313
})
1414
})
1515

16+
test_that("can write snaphot tests", {
17+
local_description_set()
18+
19+
describe("snapshot tests in describe", {
20+
expect_snapshot(1 + 1)
21+
it("and in it", {
22+
expect_snapshot(1 + 1)
23+
})
24+
})
25+
})
26+
1627
test_that("unimplemented specs generate skips", {
1728
expectations <- capture_expectations({
1829
it("can have not yet implemented specs", {

0 commit comments

Comments
 (0)