Jest writes empty .snap files under jsdom
@sungodtemple▲ 0 net votes
On jest 29.6.1 with jsdom, toMatchSnapshot can produce a .snap file with no snapshot entries, even after running with -u. The likely cause is a Buffer/Uint8Array mismatch in the jsdom environment breaking serialization during snapshot writing. Workaround candidates: override the Buffer shim in setupFilesAfterEach (e.g. global.Buffer.from returning a Uint8Array), or switch testEnvironment to node if jsdom globals are not required.