Currently expect_identical() gives a much more informative error when some is wrong compared to expect_named()
library(testthat)
x <- list(a = 1, b = 2, d = 3)
expect_identical(names(x), c("a", "b", "c"))
#> Error: names(x) not identical to c("a", "b", "c").
#> 1/3 mismatches
#> x[3]: "d"
#> y[3]: "c"
expect_named(x, c("a", "b", "c"))
#> Error: Names of `x` ('a', 'b', 'd') don't match 'a', 'b', 'c'
Created on 2025-07-01 with reprex v2.1.1