Skip to content

Files

Latest commit

 

History

History
27 lines (19 loc) · 637 Bytes

expect_identical_linter.md

File metadata and controls

27 lines (19 loc) · 637 Bytes

Pattern: Missing use of expect_identical(x, y)

Issue: -

Description

Enforces the usage of testthat::expect_identical() as the default expectation for comparisons in a testthat suite. expect_true(identical(x, y)) is an equivalent but unadvised method of the same test.

Examples

# will produce lints
lint(
  text = "expect_equal(x, y)",
  linters = expect_identical_linter()
)

# okay
lint(
  text = "expect_identical(x, y)",
  linters = expect_identical_linter()
)

Further Reading