This is a recreation for the issue
When you import a module X in a mock, its instance or reference is not the same for that same module imported in your source. That causes you to not be able to use the instanceof operator successfully.
npm install
grunt castle