Jasmine custom matcher: toBeInstanceOf
Recently I found myself in need of a custom matcher for my Jasmine-based unit tests. I looked around and only found a few some outdated examples, so I wrote my own. Here it is so you don’t have to do the same. It’s in TypeScript: if you prefer plain JS you can simply take the types out and ignore the bottom declaration.