Typeof check for shims
Refactor in mocha tests
Refactor in mocha tests to assert style