'Tests with `expect_doppelganger()` fail after upgrade to R 4.2.0

After the update to R 4.2.0, all tests using expect_doppelganger() from vdiffr fail with the following message:

Error in svglite_(filename, bg, width, height, pointsize, standalone,  : 
  Graphics API version mismatch

How can I fix these tests?



Solution 1:[1]

Simply reinstalling the package vdiffr resolved the issue. There was not even a change to the snapshot images used in the test.

More information regarding this update to the graphics engine can be found in this blog post, where it is state that

For users of R packages that provide graphics devices, those packages will need to be reinstalled when updating to R 4.2.0.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Stibu