Browser tests were kinda flaky because I misunderstood the nature of WebAuthn's errors (they're not discrete subclasses, but simply Error subclasses with custom names), and TypeScript wasn't liking the way I tried to declare the various error subclasses globally in the Jest environment. Try as I might, I think I'm running into some monorepo limitations of declaring custom types specifically for testing. I would be happy to end up wrong about this...
In lieu of globally defining unique Error subclasses, I've instead migrated to a new helper method in helpers/__jest__/ that can be imported like normal to easily generate these subclasses. TypeScript has no problem with this when running either test or test:watch scripts, and so this should resolve these tests working fine in CI but misbehaving during local development.
Browser tests were kinda flaky because I misunderstood the nature of WebAuthn's errors (they're not discrete subclasses, but simply
Error
subclasses with customname
s), and TypeScript wasn't liking the way I tried to declare the various error subclasses globally in the Jest environment. Try as I might, I think I'm running into some monorepo limitations of declaring custom types specifically for testing. I would be happy to end up wrong about this...In lieu of globally defining unique Error subclasses, I've instead migrated to a new helper method in
helpers/__jest__/
that can be imported like normal to easily generate these subclasses. TypeScript has no problem with this when running eithertest
ortest:watch
scripts, and so this should resolve these tests working fine in CI but misbehaving during local development.