react-native-mock testing ReferenceError: Map is not defined
<p>I have writing some simple tests for React Native and running them on <a href="https://circleci.com" rel="nofollow">CircleCI</a>, but I get the follow error: ReferenceError: Map is not defined</p>

<p>I am aware that Map is a new ES6 feature but unsure of why I am getting this error. My test script includes <code>--compilers babel-core/register</code> but it does not look like babel is compiling some code in the <a href="https://github.com/lelandrichardson/react-native-mock/blob/master/src/api/AppState.js#L8" rel="nofollow">react-native-mock</a> library.</p>

<p>I do not think this is specific to react-native-mock, but I did notice that library requires <code>babel-core/register</code> in their <a href="https://github.com/lelandrichardson/react-native-mock/blob/master/package.json#L8" rel="nofollow">test script</a>: <code>"test": "mocha --require babel-core/register test/**/*.js",</code></p>

<p>I tried that as well and got a <code>Error: Cannot find module 'js:babel-core/register'</code> despite my having babel-core in my saved dependencies.</p>

<p>Any constructive help would greatly be appreciated.</p>

<pre><code>$ npm test

&gt; BlocMessenger@0.0.1 test /home/ubuntu/Messenger
&gt; mocha --require react-native-mock/mock.js --compilers js:babel-core/register --recursive App/**/__tests__/*.test.js


/home/ubuntu/Messenger/node_modules/react-native-mock/build/api/AppState.js:18
  change: new Map(),
              ^
ReferenceError: Map is not defined
    at Object.&lt;anonymous&gt; (/home/ubuntu/Messenger/node_modules/react-native-mock/build/api/AppState.js:18:15)
    at Module._compile (module.js:456:26)
    at Module._extensions..js (module.js:474:10)
    at Object.require.extensions.(anonymous function) [as .js] (/home/ubuntu/Messenger/node_modules/babel-core/node_modules/babel-register/lib/node.js:134:7)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.&lt;anonymous&gt; (/home/ubuntu/Messenger/node_modules/react-native-mock/build/react-native.js:66:13)
    at Module._compile (module.js:456:26)
    at Module._extensions..js (module.js:474:10)
    at Object.require.extensions.(anonymous function) [as .js] (/home/ubuntu/Messenger/node_modules/babel-core/node_modules/babel-register/lib/node.js:134:7)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.&lt;anonymous&gt; (/home/ubuntu/Messenger/node_modules/react-native-mock/mock.js:1:85)
    at Module._compile (module.js:456:26)
    at Module._extensions..js (module.js:474:10)
    at Object.require.extensions.(anonymous function) [as .js] (/home/ubuntu/Messenger/node_modules/babel-core/node_modules/babel-register/lib/node.js:134:7)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at args (/home/ubuntu/nvm/v0.10.33/lib/node_modules/mocha/bin/_mocha:310:3)
    at Array.forEach (native)
    at Object.&lt;anonymous&gt; (/home/ubuntu/nvm/v0.10.33/lib/node_modules/mocha/bin/_mocha:309:10)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:906:3
npm ERR! Test failed.  See above for more details.

npm test returned exit code 1
</code></pre>