Repository: parse-community/Parse-SDK-JS
Pull request #2499 (2025-03-13 00:49:34)

refactor: Remove `module.exports` in favor of `export default`
## Pull Request

- Report security issues [confidentially](https://github.com/parse-community/Parse-SDK-JS/security/policy).
- Any contribution is under this [license](https://github.com/parse-community/Parse-SDK-JS/blob/alpha/LICENSE).
- Link this pull request to an [issue](https://github.com/parse-community/Parse-SDK-JS/issues?q=is%3Aissue).

## Issue
<!-- Add the link to the issue that this PR closes. -->
Don't need both `module.exports` and `export default`. We use export default for ES Module support

## Approach
<!-- Describe the changes in this PR. -->
* Change the way modules are imported in cjs tests (.default)

There is still one module.exports left (in Parse.ts). I left this for when we migrate from browserify to a modern build system like https://github.com/parse-community/Parse-SDK-JS/pull/2425.

## Tasks
<!-- Delete tasks that don't apply. -->

- [x] Add tests
- [x] Add changes to documentation (guides, repository pages, code comments)


parse-github-assistant[bot]: 
🚀 Thanks for opening this pull request! 

<!-- parse-issue-bot-meta-tag-id {"suggestPr":false,"thanksFeature":false,"thanksPr":false} -->


codecov[bot]: ## [Codecov](https://app.codecov.io/gh/parse-community/Parse-SDK-JS/pull/2499?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=parse-community) Report
All modified and coverable lines are covered by tests :white_check_mark:
> Project coverage is 100.00%. Comparing base [(`478147c`)](https://app.codecov.io/gh/parse-community/Parse-SDK-JS/commit/478147c5a68b23182f7f9fd0e1fede1069af25f9?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=parse-community) to head [(`8471ee4`)](https://app.codecov.io/gh/parse-community/Parse-SDK-JS/commit/8471ee4fb578b723b59857214757f70f11b135b7?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=parse-community).

<details><summary>Additional details and impacted files</summary>


```diff
@@            Coverage Diff            @@
##             alpha     #2499   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           64        64           
  Lines         6268      6244   -24     
  Branches      1468      1468           
=========================================
- Hits          6268      6244   -24     
```

</details>

[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/parse-community/Parse-SDK-JS/pull/2499?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=parse-community).   
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=parse-community).

<details><summary>🚀 New features to boost your workflow: </summary>

- ❄ [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- 📦 [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
dplewis: Closing to work on https://github.com/parse-community/Parse-SDK-JS/pull/2425

Patch:
diff --git a/src/CoreManager.ts b/src/CoreManager.ts
index 927e286..f688917 100644
--- a/src/CoreManager.ts
+++ b/src/CoreManager.ts
@@ -721,5 +721,4 @@ const CoreManager = {
   },
 };
 
-module.exports = CoreManager;
 export default CoreManager;
diff --git a/src/CryptoController.ts b/src/CryptoController.ts
index 211c5d2..14c1ea2 100644
--- a/src/CryptoController.ts
+++ b/src/CryptoController.ts
@@ -22,5 +22,4 @@ const CryptoController = {
   },
 };
 
-module.exports = CryptoController;
 export default CryptoController;
diff --git a/src/EventEmitter.ts b/src/EventEmitter.ts
index 4f96564..d0adf68 100644
--- a/src/EventEmitter.ts
+++ b/src/EventEmitter.ts
@@ -17,5 +17,5 @@ try {
 } catch (_) {
   // EventEmitter unavailable
 }
-module.exports = EventEmitter;
+
 export default EventEmitter;
diff --git a/src/EventuallyQueue.ts b/src/EventuallyQueue.ts
index 2e3d0ab..972d297 100644
--- a/src/EventuallyQueue.ts
+++ b/src/EventuallyQueue.ts
@@ -355,5 +355,4 @@ const EventuallyQueue = {
   },
 };
 
-module.exports = EventuallyQueue;
 export default EventuallyQueue;
diff --git a/src/IndexedDBStorageController.ts b/src/IndexedDBStorageController.ts
index 30a6726..ff1e80d 100644
--- a/src/IndexedDBStorageController.ts
+++ b/src/IndexedDBStorageController.ts
@@ -34,5 +34,5 @@ if (typeof window !== 'undefined' && window.indexedDB) {
   // IndexedDB not supported
   IndexedDBStorageController = undefined;
 }
-module.exports = IndexedDBStorageController;
+
 export default IndexedDBStorageController;
diff --git a/src/InstallationController.ts b/src/InstallationController.ts
index 782e5f6..ebf25db 100644
--- a/src/InstallationController.ts
+++ b/src/InstallationController.ts
@@ -77,5 +77,4 @@ const InstallationController = {
   },
 };
 
-module.exports = InstallationController;
 export default InstallationController;
diff --git a/src/LocalDatastore.ts b/src/LocalDatastore.ts
index 4720d7f..069a44c 100644
--- a/src/LocalDatastore.ts
+++ b/src/LocalDatastore.ts
@@ -387,7 +387,6 @@ const LocalDatastore = {
   },
 };
 
-module.exports = LocalDatastore;
 export default LocalDatastore;
 
 CoreManager.setLocalDatastoreController(LocalDatastoreController);
diff --git a/src/LocalDatastoreController.default.ts b/src/LocalDatastoreController.default.ts
index 29a1c36..80bbba4 100644
--- a/src/LocalDatastoreController.default.ts
+++ b/src/LocalDatastoreController.default.ts
@@ -61,5 +61,4 @@ const LocalDatastoreController = {
   },
 };
 
-module.exports = LocalDatastoreController;
 export default LocalDatastoreController;
diff --git a/src/LocalDatastoreController.react-native.ts b/src/LocalDatastoreController.react-native.ts
index e877d30..c555bff 100644
--- a/src/LocalDatastoreController.react-native.ts
+++ b/src/LocalDatastoreController.react-native.ts
@@ -80,5 +80,4 @@ const LocalDatastoreController = {
   },
 };
 
-module.exports = LocalDatastoreController;
 export default LocalDatastoreController;
diff --git a/src/LocalDatastoreController.ts b/src/LocalDatastoreController.ts
index f0acfea..7f4e969 100644
--- a/src/LocalDatastoreController.ts
+++ b/src/LocalDatastoreController.ts
@@ -6,5 +6,5 @@ let LocalDatastoreController: any = DefaultLocalDatastoreController;
 if (process.env.PARSE_BUILD === 'react-native') {
   LocalDatastoreController = RNLocalDatastoreController;
 }
-module.exports = LocalDatastoreController;
+
 export default LocalDatastoreController;
diff --git a/src/OfflineQuery.ts b/src/OfflineQuery.ts
index 17e80ae..7ffe18a 100644
--- a/src/OfflineQuery.ts
+++ b/src/OfflineQuery.ts
@@ -591,5 +591,4 @@ const OfflineQuery = {
   validateQuery: validateQuery,
 };
 
-module.exports = OfflineQuery;
 export default OfflineQuery;
diff --git a/src/ParseInstallation.ts b/src/ParseInstallation.ts
index 9d90ae1..8110e4a 100644
--- a/src/ParseInstallation.ts
+++ b/src/ParseInstallation.ts
@@ -286,5 +286,4 @@ class ParseInstallation<T extends Attributes = Attributes> extends ParseObject<T
 
 ParseObject.registerSubclass('_Installation', ParseInstallation);
 
-module.exports = ParseInstallation;
 export default ParseInstallation;
diff --git a/src/RESTController.ts b/src/RESTController.ts
index 994ffcd..c0ea0b2 100644
--- a/src/RESTController.ts
+++ b/src/RESTController.ts
@@ -361,5 +361,4 @@ const RESTController = {
   },
 };
 
-module.exports = RESTController;
 export default RESTController;
diff --git a/src/Socket.weapp.ts b/src/Socket.weapp.ts
index 768a480..63575d4 100644
--- a/src/Socket.weapp.ts
+++ b/src/Socket.weapp.ts
@@ -49,5 +49,5 @@ class SocketWeapp {
     wx.closeSocket();
   }
 }
-module.exports = SocketWeapp;
+
 export default SocketWeapp;
diff --git a/src/Storage.ts b/src/Storage.ts
index 6514361..45b6ffe 100644
--- a/src/Storage.ts
+++ b/src/Storage.ts
@@ -91,5 +91,4 @@ const Storage = {
   },
 };
 
-module.exports = Storage;
 export default Storage;
diff --git a/src/StorageController.browser.ts b/src/StorageController.browser.ts
index 924b5a1..e7962bc 100644
--- a/src/StorageController.browser.ts
+++ b/src/StorageController.browser.ts
@@ -33,5 +33,4 @@ const StorageController = {
   },
 };
 
-module.exports = StorageController;
 export default StorageController;
diff --git a/src/StorageController.default.ts b/src/StorageController.default.ts
index 08ee16e..53cec60 100644
--- a/src/StorageController.default.ts
+++ b/src/StorageController.default.ts
@@ -31,5 +31,4 @@ const StorageController = {
   },
 };
 
-module.exports = StorageController;
 export default StorageController;
diff --git a/src/StorageController.react-native.ts b/src/StorageController.react-native.ts
index 23658a1..375b047 100644
--- a/src/StorageController.react-native.ts
+++ b/src/StorageController.react-native.ts
@@ -80,5 +80,4 @@ const StorageController = {
   },
 };
 
-module.exports = StorageController;
 export default StorageController;
diff --git a/src/StorageController.ts b/src/StorageController.ts
index 1c26076..0f52b1a 100644
--- a/src/StorageController.ts
+++ b/src/StorageController.ts
@@ -12,5 +12,5 @@ if (process.env.PARSE_BUILD === 'react-native') {
 } else if (process.env.PARSE_BUILD === 'weapp') {
   StorageController = WeappStorageController;
 }
-module.exports = StorageController;
+
 export default StorageController;
diff --git a/src/StorageController.weapp.ts b/src/StorageController.weapp.ts
index 9cead45..80f903e 100644
--- a/src/StorageController.weapp.ts
+++ b/src/StorageController.weapp.ts
@@ -32,5 +32,4 @@ const StorageController = {
   },
 };
 
-module.exports = StorageController;
 export default StorageController;
diff --git a/src/TaskQueue.ts b/src/TaskQueue.ts
index 0934810..92ed530 100644
--- a/src/TaskQueue.ts
+++ b/src/TaskQueue.ts
@@ -51,5 +51,4 @@ class TaskQueue {
   }
 }
 
-module.exports = TaskQueue;
 export default TaskQueue;
diff --git a/src/WebSocketController.ts b/src/WebSocketController.ts
index e5daa47..f1e0175 100644
--- a/src/WebSocketController.ts
+++ b/src/WebSocketController.ts
@@ -18,5 +18,5 @@ try {
 } catch (_) {
   // WebSocket unavailable
 }
-module.exports = WebSocketController;
+
 export default WebSocketController;
diff --git a/src/Xhr.weapp.ts b/src/Xhr.weapp.ts
index b001c9e..ffaa193 100644
--- a/src/Xhr.weapp.ts
+++ b/src/Xhr.weapp.ts
@@ -107,5 +107,5 @@ class XhrWeapp {
     });
   }
 }
-module.exports = XhrWeapp;
+
 export default XhrWeapp;
diff --git a/src/uuid.ts b/src/uuid.ts
index 1ba54b8..6278245 100644
--- a/src/uuid.ts
+++ b/src/uuid.ts
@@ -20,5 +20,4 @@ if (process.env.PARSE_BUILD === 'weapp') {
   uuid = v4;
 }
 
-module.exports = uuid;
 export default uuid;


Test patch:
diff --git a/integration/test/ParseLocalDatastoreTest.js b/integration/test/ParseLocalDatastoreTest.js
index a77bcde..c26134e 100644
--- a/integration/test/ParseLocalDatastoreTest.js
+++ b/integration/test/ParseLocalDatastoreTest.js
@@ -29,7 +29,7 @@ function runTest(controller) {
 
   describe(`Parse Object Pinning (${controller.name})`, () => {
     beforeEach(async () => {
-      const StorageController = require(controller.file);
+      const StorageController = require(controller.file).default;
       Parse.CoreManager.setAsyncStorage(mockRNStorage);
       Parse.CoreManager.setLocalDatastoreController(StorageController);
       Parse.CoreManager.setEventEmitter(require('events').EventEmitter);
@@ -1073,7 +1073,7 @@ function runTest(controller) {
 
   describe(`Parse Query Pinning (${controller.name})`, () => {
     beforeEach(async () => {
-      const StorageController = require(controller.file);
+      const StorageController = require(controller.file).default;
       Parse.CoreManager.setAsyncStorage(mockRNStorage);
       Parse.CoreManager.setLocalDatastoreController(StorageController);
       Parse.CoreManager.setEventEmitter(require('events').EventEmitter);
diff --git a/integration/test/ParseReactNativeTest.js b/integration/test/ParseReactNativeTest.js
index dac0d79..cb2faf1 100644
--- a/integration/test/ParseReactNativeTest.js
+++ b/integration/test/ParseReactNativeTest.js
@@ -2,10 +2,11 @@
 
 const Parse = require('../../react-native');
 const { resolvingPromise } = require('../../lib/react-native/promiseUtils');
-const CryptoController = require('../../lib/react-native/CryptoController');
-const LocalDatastoreController = require('../../lib/react-native/LocalDatastoreController.default');
-const StorageController = require('../../lib/react-native/StorageController.default');
-const RESTController = require('../../lib/react-native/RESTController');
+const CryptoController = require('../../lib/react-native/CryptoController').default;
+const LocalDatastoreController =
+  require('../../lib/react-native/LocalDatastoreController.default').default;
+const StorageController = require('../../lib/react-native/StorageController.default').default;
+const RESTController = require('../../lib/react-native/RESTController').default;
 
 RESTController._setXHR(require('xmlhttprequest').XMLHttpRequest);
 
diff --git a/src/__tests__/Analytics-test.js b/src/__tests__/Analytics-test.js
index c539337..13bc703 100644
--- a/src/__tests__/Analytics-test.js
+++ b/src/__tests__/Analytics-test.js
@@ -2,7 +2,7 @@ jest.dontMock('../Analytics');
 jest.dontMock('../CoreManager');
 
 const Analytics = require('../Analytics');
-const CoreManager = require('../CoreManager');
+const CoreManager = require('../CoreManager').default;
 
 const defaultController = CoreManager.getAnalyticsController();
 
diff --git a/src/__tests__/Cloud-test.js b/src/__tests__/Cloud-test.js
index 67045f1..6ed1e84 100644
--- a/src/__tests__/Cloud-test.js
+++ b/src/__tests__/Cloud-test.js
@@ -9,7 +9,7 @@ jest.dontMock('../Push');
 jest.dontMock('../ParseOp');
 
 const Cloud = require('../Cloud');
-const CoreManager = require('../CoreManager');
+const CoreManager = require('../CoreManager').default;
 const Push = require('../Push');
 require('../ParseOp');
 
diff --git a/src/__tests__/CoreManager-test.js b/src/__tests__/CoreManager-test.js
index 0dd3aaf..3cfd8a6 100644
--- a/src/__tests__/CoreManager-test.js
+++ b/src/__tests__/CoreManager-test.js
@@ -1,6 +1,6 @@
 jest.dontMock('../CoreManager');
 
-const CoreManager = require('../CoreManager');
+const CoreManager = require('../CoreManager').default;
 
 describe('CoreManager', () => {
   it('is initialized with default values', () => {
diff --git a/src/__tests__/EventuallyQueue-test.js b/src/__tests__/EventuallyQueue-test.js
index da4486c..10d6226 100644
--- a/src/__tests__/EventuallyQueue-test.js
+++ b/src/__tests__/EventuallyQueue-test.js
@@ -34,22 +34,26 @@ class MockObject {
     return MockSubclass;
   }
 }
-jest.setMock('../ParseObject', MockObject);
+jest.setMock('../ParseObject', {
+  __esModule: true,
+  default: MockObject,
+});
 
 const mockQueryFind = jest.fn();
-jest.mock('../ParseQuery', () => {
-  return jest.fn().mockImplementation(function () {
+jest.mock('../ParseQuery', () => ({
+  __esModule: true,
+  default: jest.fn().mockImplementation(function () {
     this.equalTo = jest.fn();
     this.find = mockQueryFind;
-  });
-});
+  }),
+}));
 const mockRNStorageInterface = require('./test_helpers/mockRNStorage');
-const CoreManager = require('../CoreManager');
-const EventuallyQueue = require('../EventuallyQueue');
+const CoreManager = require('../CoreManager').default;
+const EventuallyQueue = require('../EventuallyQueue').default;
 const ParseError = require('../ParseError').default;
-const ParseObject = require('../ParseObject');
-const RESTController = require('../RESTController');
-const Storage = require('../Storage');
+const ParseObject = require('../ParseObject').default;
+const RESTController = require('../RESTController').default;
+const Storage = require('../Storage').default;
 const mockXHR = require('./test_helpers/mockXHR');
 const flushPromises = require('./test_helpers/flushPromises');
 
@@ -65,7 +69,7 @@ describe('EventuallyQueue', () => {
   beforeEach(async () => {
     jest.clearAllMocks();
     CoreManager.setAsyncStorage(mockRNStorageInterface);
-    CoreManager.setStorageController(require('../StorageController.react-native'));
+    CoreManager.setStorageController(require('../StorageController.react-native').default);
     CoreManager.setRESTController(RESTController);
     EventuallyQueue.stopPoll();
     await EventuallyQueue.clear();
diff --git a/src/__tests__/Hooks-test.js b/src/__tests__/Hooks-test.js
index 2bac07f..41d8ac9 100644
--- a/src/__tests__/Hooks-test.js
+++ b/src/__tests__/Hooks-test.js
@@ -7,8 +7,8 @@ jest.dontMock('../ParseObject');
 jest.dontMock('../RESTController');
 
 const Hooks = require('../ParseHooks');
-const CoreManager = require('../CoreManager');
-const RESTController = require('../RESTController');
+const CoreManager = require('../CoreManager').default;
+const RESTController = require('../RESTController').default;
 
 const defaultController = CoreManager.getHooksController();
 const { sendRequest } = defaultController;
diff --git a/src/__tests__/InstallationController-test.js b/src/__tests__/InstallationController-test.js
index efcb97b..c76696a 100644
--- a/src/__tests__/InstallationController-test.js
+++ b/src/__tests__/InstallationController-test.js
@@ -15,12 +15,12 @@ jest.mock('../uuid', () => {
   return () => value++ + '';
 });
 
-const CoreManager = require('../CoreManager');
-const ParseInstallation = require('../ParseInstallation');
-const InstallationController = require('../InstallationController');
-const Storage = require('../Storage');
+const CoreManager = require('../CoreManager').default;
+const ParseInstallation = require('../ParseInstallation').default;
+const InstallationController = require('../InstallationController').default;
+const Storage = require('../Storage').default;
 
-CoreManager.setStorageController(require('../StorageController.default'));
+CoreManager.setStorageController(require('../StorageController.default').default);
 
 describe('InstallationController', () => {
   beforeEach(() => {
diff --git a/src/__tests__/LiveQueryClient-test.js b/src/__tests__/LiveQueryClient-test.js
index be9c90f..c8fa0ba 100644
--- a/src/__tests__/LiveQueryClient-test.js
+++ b/src/__tests__/LiveQueryClient-test.js
@@ -35,12 +35,12 @@ const mockLocalDatastore = {
 };
 jest.setMock('../LocalDatastore', mockLocalDatastore);
 
-const CoreManager = require('../CoreManager');
-const EventEmitter = require('../EventEmitter');
+const CoreManager = require('../CoreManager').default;
+const EventEmitter = require('../EventEmitter').default;
 const LiveQueryClient = require('../LiveQueryClient').default;
 const ParseObject = require('../ParseObject').default;
 const ParseQuery = require('../ParseQuery').default;
-const WebSocketController = require('../WebSocketController');
+const WebSocketController = require('../WebSocketController').default;
 const { resolvingPromise } = require('../promiseUtils');
 const events = require('events');
 
diff --git a/src/__tests__/LocalDatastore-test.js b/src/__tests__/LocalDatastore-test.js
index 5c96768..e6ec14b 100644
--- a/src/__tests__/LocalDatastore-test.js
+++ b/src/__tests__/LocalDatastore-test.js
@@ -78,30 +78,36 @@ const mockLocalStorageController = {
   getAllContents: jest.fn(),
   clear: jest.fn(),
 };
-jest.setMock('../ParseObject', MockObject);
+jest.setMock('../ParseObject', {
+  __esModule: true,
+  default: MockObject,
+});
 
 const mockQueryFind = jest.fn();
-jest.mock('../ParseQuery', () => {
-  return jest.fn().mockImplementation(function () {
+jest.mock('../ParseQuery', () => ({
+  __esModule: true,
+  default: jest.fn().mockImplementation(function () {
     this.equalTo = jest.fn();
     this.containedIn = jest.fn();
     this.limit = jest.fn();
     this.find = mockQueryFind;
-  });
-});
+  }),
+}));
 
-const CoreManager = require('../CoreManager');
-const LocalDatastore = require('../LocalDatastore');
-const ParseObject = require('../ParseObject');
-const ParseQuery = require('../ParseQuery');
+const CoreManager = require('../CoreManager').default;
+const LocalDatastore = require('../LocalDatastore').default;
+const ParseObject = require('../ParseObject').default;
+const ParseQuery = require('../ParseQuery').default;
 const ParseUser = require('../ParseUser').default;
-const LocalDatastoreController = require('../LocalDatastoreController');
-const RNDatastoreController = require('../LocalDatastoreController.react-native');
-const BrowserStorageController = require('../StorageController.browser');
-const DefaultStorageController = require('../StorageController.default');
+const LocalDatastoreController = require('../LocalDatastoreController').default;
+const RNDatastoreController = require('../LocalDatastoreController.react-native').default;
+const BrowserStorageController = require('../StorageController.browser').default;
+const DefaultStorageController = require('../StorageController.default').default;
 // Register our mocks
-jest.spyOn(CoreManager, 'getParseObject').mockImplementation(() => require('../ParseObject'));
-jest.spyOn(CoreManager, 'getParseQuery').mockImplementation(() => require('../ParseQuery'));
+jest
+  .spyOn(CoreManager, 'getParseObject')
+  .mockImplementation(() => require('../ParseObject').default);
+jest.spyOn(CoreManager, 'getParseQuery').mockImplementation(() => require('../ParseQuery').default);
 
 const item1 = new ParseObject('Item');
 const item2 = new ParseObject('Item');
diff --git a/src/__tests__/ObjectStateMutations-test.js b/src/__tests__/ObjectStateMutations-test.js
index 99dbe51..e6b1189 100644
--- a/src/__tests__/ObjectStateMutations-test.js
+++ b/src/__tests__/ObjectStateMutations-test.js
@@ -13,12 +13,12 @@ const mockObject = function (className) {
 };
 mockObject.registerSubclass = function () {};
 jest.setMock('../ParseObject', mockObject);
-const CoreManager = require('../CoreManager');
+const CoreManager = require('../CoreManager').default;
 CoreManager.setParseObject(mockObject);
 
 const ObjectStateMutations = require('../ObjectStateMutations');
 const ParseOps = require('../ParseOp');
-const TaskQueue = require('../TaskQueue');
+const TaskQueue = require('../TaskQueue').default;
 
 describe('ObjectStateMutations', () => {
   it('can apply server data', () => {
diff --git a/src/__tests__/OfflineQuery-test.js b/src/__tests__/OfflineQuery-test.js
index 5d1e645..a80f5e6 100644
--- a/src/__tests__/OfflineQuery-test.js
+++ b/src/__tests__/OfflineQuery-test.js
@@ -1,7 +1,6 @@
 jest.autoMockOff();
 
-const matchesQuery = require('../OfflineQuery').matchesQuery;
-const validateQuery = require('../OfflineQuery').validateQuery;
+const { matchesQuery, validateQuery } = require('../OfflineQuery').default;
 const ParseError = require('../ParseError').default;
 const ParseObject = require('../ParseObject').default;
 const ParseQuery = require('../ParseQuery').default;
diff --git a/src/__tests__/Parse-test.js b/src/__tests__/Parse-test.js
index 8a4d9c4..a968de2 100644
--- a/src/__tests__/Parse-test.js
+++ b/src/__tests__/Parse-test.js
@@ -11,7 +11,7 @@ jest.dontMock('crypto-js/aes');
 jest.setMock('../EventuallyQueue', { poll: jest.fn() });
 
 global.indexedDB = require('./test_helpers/mockIndexedDB');
-const CoreManager = require('../CoreManager');
+const CoreManager = require('../CoreManager').default;
 const ParseLiveQuery = require('../ParseLiveQuery').default;
 const EventuallyQueue = require('../EventuallyQueue');
 const Parse = require('../Parse');
diff --git a/src/__tests__/ParseACL-test.js b/src/__tests__/ParseACL-test.js
index 4b4ee0d..2ed1921 100644
--- a/src/__tests__/ParseACL-test.js
+++ b/src/__tests__/ParseACL-test.js
@@ -13,7 +13,7 @@ jest.setMock('../ParseRole', mockRole);
 const ParseACL = require('../ParseACL').default;
 const ParseUser = require('../ParseUser').default;
 const ParseRole = require('../ParseRole');
-const CoreManager = require('../CoreManager');
+const CoreManager = require('../CoreManager').default;
 CoreManager.setParseRole(require('../ParseRole'));
 
 describe('ParseACL', () => {
diff --git a/src/__tests__/ParseConfig-test.js b/src/__tests__/ParseConfig-test.js
index 135ee91..f37779a 100644
--- a/src/__tests__/ParseConfig-test.js
+++ b/src/__tests__/ParseConfig-test.js
@@ -16,11 +16,11 @@ jest.dontMock('./test_helpers/mockAsyncStorage');
 require('../ParseObject');
 require('../ParseOp');
 const mockAsyncStorage = require('./test_helpers/mockAsyncStorage');
-const CoreManager = require('../CoreManager');
+const CoreManager = require('../CoreManager').default;
 const ParseConfig = require('../ParseConfig').default;
 const ParseGeoPoint = require('../ParseGeoPoint').default;
-const Storage = require('../Storage');
-const StorageController = require('../StorageController.default');
+const Storage = require('../Storage').default;
+const StorageController = require('../StorageController.default').default;
 
 CoreManager.set('APPLICATION_ID', 'A');
 CoreManager.set('JAVASCRIPT_KEY', 'B');
diff --git a/src/__tests__/ParseError-test.js b/src/__tests__/ParseError-test.js
index 5bbb5f8..4cdc813 100644
--- a/src/__tests__/ParseError-test.js
+++ b/src/__tests__/ParseError-test.js
@@ -2,7 +2,7 @@ jest.dontMock('../ParseError');
 jest.dontMock('../CoreManager');
 
 const ParseError = require('../ParseError').default;
-const CoreManager = require('../CoreManager');
+const CoreManager = require('../CoreManager').default;
 
 describe('ParseError', () => {
   it('have sensible string representation', () => {
diff --git a/src/__tests__/ParseFile-test.js b/src/__tests__/ParseFile-test.js
index 09a2669..56251b0 100644
--- a/src/__tests__/ParseFile-test.js
+++ b/src/__tests__/ParseFile-test.js
@@ -8,8 +8,8 @@ const ParseFile = require('../ParseFile').default;
 const b64Digit = require('../ParseFile').b64Digit;
 
 const ParseObject = require('../ParseObject').default;
-const CoreManager = require('../CoreManager');
-const EventEmitter = require('../EventEmitter');
+const CoreManager = require('../CoreManager').default;
+const EventEmitter = require('../EventEmitter').default;
 
 const mockHttp = require('http');
 const mockHttps = require('https');
diff --git a/src/__tests__/ParseInstallation-test.js b/src/__tests__/ParseInstallation-test.js
index 8ed3993..0439e8a 100644
--- a/src/__tests__/ParseInstallation-test.js
+++ b/src/__tests__/ParseInstallation-test.js
@@ -13,9 +13,9 @@ jest.dontMock('../SingleInstanceStateController');
 jest.dontMock('../UniqueInstanceStateController');
 
 const ParseError = require('../ParseError').default;
-const LocalDatastore = require('../LocalDatastore');
-const ParseInstallation = require('../ParseInstallation');
-const CoreManager = require('../CoreManager');
+const LocalDatastore = require('../LocalDatastore').default;
+const ParseInstallation = require('../ParseInstallation').default;
+const CoreManager = require('../CoreManager').default;
 
 describe('ParseInstallation', () => {
   it('can create ParseInstallation', () => {
diff --git a/src/__tests__/ParseLiveQuery-test.js b/src/__tests__/ParseLiveQuery-test.js
index 7d00a59..ba1e74a 100644
--- a/src/__tests__/ParseLiveQuery-test.js
+++ b/src/__tests__/ParseLiveQuery-test.js
@@ -10,8 +10,8 @@ jest.dontMock('../promiseUtils');
 
 // Forces the loading
 const ParseLiveQuery = require('../ParseLiveQuery').default;
-const CoreManager = require('../CoreManager');
-const EventEmitter = require('../EventEmitter');
+const CoreManager = require('../CoreManager').default;
+const EventEmitter = require('../EventEmitter').default;
 const ParseQuery = require('../ParseQuery').default;
 const LiveQuerySubscription = require('../LiveQuerySubscription').default;
 const mockLiveQueryClient = {
diff --git a/src/__tests__/ParseObject-test.js b/src/__tests__/ParseObject-test.js
index 127b7a0..176f6a6 100644
--- a/src/__tests__/ParseObject-test.js
+++ b/src/__tests__/ParseObject-test.js
@@ -143,8 +143,8 @@ const mockLocalDatastore = {
 };
 jest.setMock('../LocalDatastore', mockLocalDatastore);
 
-const CoreManager = require('../CoreManager');
-const EventuallyQueue = require('../EventuallyQueue');
+const CoreManager = require('../CoreManager').default;
+const EventuallyQueue = require('../EventuallyQueue').default;
 const ParseACL = require('../ParseACL').default;
 const ParseError = require('../ParseError').default;
 const ParseFile = require('../ParseFile').default;
@@ -152,7 +152,7 @@ const ParseGeoPoint = require('../ParseGeoPoint').default;
 const ParsePolygon = require('../ParsePolygon').default;
 const ParseObject = require('../ParseObject').default;
 const ParseOp = require('../ParseOp');
-const RESTController = require('../RESTController');
+const RESTController = require('../RESTController').default;
 const SingleInstanceStateController = require('../SingleInstanceStateController');
 const unsavedChildren = require('../unsavedChildren').default;
 
diff --git a/src/__tests__/ParseOp-test.js b/src/__tests__/ParseOp-test.js
index 8389045..82075d2 100644
--- a/src/__tests__/ParseOp-test.js
+++ b/src/__tests__/ParseOp-test.js
@@ -20,22 +20,30 @@ mockObject.fromJSON = function (json) {
   return new mockObject(json.className, json.objectId);
 };
 mockObject.registerSubclass = function () {};
-jest.setMock('../ParseObject', mockObject);
+jest.setMock('../ParseObject', {
+  __esModule: true,
+  default: mockObject,
+});
 
 const mockRelation = function (parent, key) {
   this.parent = parent;
   this.key = key;
 };
-jest.setMock('../ParseRelation', mockRelation);
+jest.setMock('../ParseRelation', {
+  __esModule: true,
+  default: mockRelation,
+});
 
-const ParseRelation = require('../ParseRelation');
-const ParseObject = require('../ParseObject');
+const ParseRelation = require('../ParseRelation').default;
+const ParseObject = require('../ParseObject').default;
 const ParseOp = require('../ParseOp');
-const CoreManager = require('../CoreManager');
-jest.spyOn(CoreManager, 'getParseObject').mockImplementation(() => require('../ParseObject'));
+const CoreManager = require('../CoreManager').default;
+jest
+  .spyOn(CoreManager, 'getParseObject')
+  .mockImplementation(() => require('../ParseObject').default);
 jest
   .spyOn(CoreManager, 'getEventuallyQueue')
-  .mockImplementation(() => require('../EventuallyQueue'));
+  .mockImplementation(() => require('../EventuallyQueue').default);
 
 const { Op, SetOp, UnsetOp, IncrementOp, AddOp, AddUniqueOp, RemoveOp, RelationOp, opFromJSON } =
   ParseOp;
diff --git a/src/__tests__/ParseQuery-test.js b/src/__tests__/ParseQuery-test.js
index ca3a7d5..5cad3c1 100644
--- a/src/__tests__/ParseQuery-test.js
+++ b/src/__tests__/ParseQuery-test.js
@@ -26,8 +26,8 @@ const mockLocalDatastore = {
 };
 jest.setMock('../LocalDatastore', mockLocalDatastore);
 
-let CoreManager = require('../CoreManager');
-const EventEmitter = require('../EventEmitter');
+let CoreManager = require('../CoreManager').default;
+const EventEmitter = require('../EventEmitter').default;
 const ParseError = require('../ParseError').default;
 const ParseGeoPoint = require('../ParseGeoPoint').default;
 let ParseObject = require('../ParseObject').default;
@@ -2302,7 +2302,7 @@ describe('ParseQuery', () => {
     jest.dontMock('../ParseObject');
     jest.resetModules();
     ParseObject = require('../ParseObject').default;
-    CoreManager = require('../CoreManager');
+    CoreManager = require('../CoreManager').default;
     ParseQuery = require('../ParseQuery').default;
 
     ParseObject.enableSingleInstance();
@@ -2352,7 +2352,7 @@ describe('ParseQuery', () => {
     jest.dontMock('../ParseObject');
     jest.resetModules();
     ParseObject = require('../ParseObject').default;
-    CoreManager = require('../CoreManager');
+    CoreManager = require('../CoreManager').default;
     ParseQuery = require('../ParseQuery').default;
 
     ParseObject.enableSingleInstance();
@@ -2427,7 +2427,7 @@ describe('ParseQuery', () => {
     jest.dontMock('../ParseObject');
     jest.resetModules();
     ParseObject = require('../ParseObject').default;
-    CoreManager = require('../CoreManager');
+    CoreManager = require('../CoreManager').default;
     ParseQuery = require('../ParseQuery').default;
 
     ParseObject.enableSingleInstance();
@@ -2477,7 +2477,7 @@ describe('ParseQuery', () => {
     jest.dontMock('../ParseObject');
     jest.resetModules();
     ParseObject = require('../ParseObject').default;
-    CoreManager = require('../CoreManager');
+    CoreManager = require('../CoreManager').default;
     ParseQuery = require('../ParseQuery').default;
 
     ParseObject.enableSingleInstance();
@@ -2897,7 +2897,7 @@ describe('ParseQuery', () => {
     jest.dontMock('../ParseObject');
     jest.resetModules();
     ParseObject = require('../ParseObject').default;
-    CoreManager = require('../CoreManager');
+    CoreManager = require('../CoreManager').default;
     ParseQuery = require('../ParseQuery').default;
 
     ParseObject.enableSingleInstance();
@@ -2933,7 +2933,7 @@ describe('ParseQuery', () => {
     jest.dontMock('../ParseObject');
     jest.resetModules();
     ParseObject = require('../ParseObject').default;
-    CoreManager = require('../CoreManager');
+    CoreManager = require('../CoreManager').default;
     ParseQuery = require('../ParseQuery').default;
 
     ParseObject.enableSingleInstance();
diff --git a/src/__tests__/ParseRelation-test.js b/src/__tests__/ParseRelation-test.js
index 92a15e0..0f78980 100644
--- a/src/__tests__/ParseRelation-test.js
+++ b/src/__tests__/ParseRelation-test.js
@@ -40,7 +40,10 @@ mockObject.prototype = {
     return finalOp;
   },
 };
-jest.setMock('../ParseObject', mockObject);
+jest.setMock('../ParseObject', {
+  __esModule: true,
+  default: mockObject,
+});
 
 const mockQuery = function (className) {
   this.className = className;
@@ -53,11 +56,14 @@ mockQuery.prototype = {
     this.where[key][comparison] = value;
   },
 };
-jest.setMock('../ParseQuery', mockQuery);
+jest.setMock('../ParseQuery', {
+  __esModule: true,
+  default: mockQuery,
+});
 
-const ParseObject = require('../ParseObject');
+const ParseObject = require('../ParseObject').default;
 const ParseRelation = require('../ParseRelation').default;
-const CoreManager = require('../CoreManager');
+const CoreManager = require('../CoreManager').default;
 CoreManager.setParseObject(mockObject);
 CoreManager.setParseQuery(mockQuery);
 CoreManager.setParseOp(require('../ParseOp'));
diff --git a/src/__tests__/ParseSchema-test.js b/src/__tests__/ParseSchema-test.js
index b3891a2..540ea90 100644
--- a/src/__tests__/ParseSchema-test.js
+++ b/src/__tests__/ParseSchema-test.js
@@ -12,6 +12,10 @@ const mockObject = function (className, id) {
   };
 };
 jest.setMock('../ParseObject', mockObject);
+jest.setMock('../ParseObject', {
+  __esModule: true,
+  default: mockObject,
+});
 
 const mockCLP = function (clp) {
   this.permissionsMap = clp;
@@ -19,12 +23,14 @@ const mockCLP = function (clp) {
     return { ...this.permissionsMap };
   };
 };
-jest.setMock('../ParseCLP', mockCLP);
-
-const ParseObject = require('../ParseObject');
-const ParseCLP = require('../ParseCLP');
+jest.setMock('../ParseCLP', {
+  __esModule: true,
+  default: mockCLP,
+});
+const ParseObject = require('../ParseObject').default;
+const ParseCLP = require('../ParseCLP').default;
 const ParseSchema = require('../ParseSchema').default;
-const CoreManager = require('../CoreManager');
+const CoreManager = require('../CoreManager').default;
 
 const defaultController = CoreManager.getSchemaController();
 
diff --git a/src/__tests__/ParseSession-test.js b/src/__tests__/ParseSession-test.js
index 6c21089..5403139 100644
--- a/src/__tests__/ParseSession-test.js
+++ b/src/__tests__/ParseSession-test.js
@@ -28,7 +28,7 @@ mockUser.current = function () {
 };
 jest.setMock('../ParseUser', mockUser);
 
-const CoreManager = require('../CoreManager');
+const CoreManager = require('../CoreManager').default;
 const ParseObject = require('../ParseObject').default;
 const ParseSession = require('../ParseSession').default;
 
diff --git a/src/__tests__/ParseUser-test.js b/src/__tests__/ParseUser-test.js
index 708666b..2a0a7b6 100644
--- a/src/__tests__/ParseUser-test.js
+++ b/src/__tests__/ParseUser-test.js
@@ -32,13 +32,13 @@ jest.dontMock('./test_helpers/mockAsyncStorage');
 
 const flushPromises = require('./test_helpers/flushPromises');
 const mockAsyncStorage = require('./test_helpers/mockAsyncStorage');
-const CoreManager = require('../CoreManager');
-const CryptoController = require('../CryptoController');
-const StorageController = require('../StorageController.default');
-const LocalDatastore = require('../LocalDatastore');
+const CoreManager = require('../CoreManager').default;
+const CryptoController = require('../CryptoController').default;
+const StorageController = require('../StorageController.default').default;
+const LocalDatastore = require('../LocalDatastore').default;
 const ParseObject = require('../ParseObject').default;
 const ParseUser = require('../ParseUser').default;
-const Storage = require('../Storage');
+const Storage = require('../Storage').default;
 const ParseError = require('../ParseError').default;
 const AnonymousUtils = require('../AnonymousUtils').default;
 
diff --git a/src/__tests__/Push-test.js b/src/__tests__/Push-test.js
index 70affe6..4bb32fe 100644
--- a/src/__tests__/Push-test.js
+++ b/src/__tests__/Push-test.js
@@ -12,10 +12,13 @@ mockQuery.prototype = {
     };
   },
 };
-jest.setMock('../ParseQuery', mockQuery);
+jest.setMock('../ParseQuery', {
+  __esModule: true,
+  default: mockQuery,
+});
 
-const CoreManager = require('../CoreManager');
-const ParseQuery = require('../ParseQuery');
+const CoreManager = require('../CoreManager').default;
+const ParseQuery = require('../ParseQuery').default;
 const Push = require('../Push');
 
 const defaultController = CoreManager.getPushController();
diff --git a/src/__tests__/RESTController-test.js b/src/__tests__/RESTController-test.js
index 45b99ae..5f9d367 100644
--- a/src/__tests__/RESTController-test.js
+++ b/src/__tests__/RESTController-test.js
@@ -5,8 +5,8 @@ jest.mock('../uuid', () => {
   return () => (value++).toString();
 });
 
-const CoreManager = require('../CoreManager');
-const RESTController = require('../RESTController');
+const CoreManager = require('../CoreManager').default;
+const RESTController = require('../RESTController').default;
 const flushPromises = require('./test_helpers/flushPromises');
 const mockXHR = require('./test_helpers/mockXHR');
 const mockWeChat = require('./test_helpers/mockWeChat');
@@ -745,7 +745,7 @@ describe('RESTController', () => {
   });
 
   it('can handle wechat request', async () => {
-    const XHR = require('../Xhr.weapp');
+    const XHR = require('../Xhr.weapp').default;
     const xhr = new XHR();
     jest.spyOn(xhr, 'open');
     jest.spyOn(xhr, 'send');
@@ -775,7 +775,7 @@ describe('RESTController', () => {
   });
 
   it('can handle wechat ajax', async () => {
-    const XHR = require('../Xhr.weapp');
+    const XHR = require('../Xhr.weapp').default;
     const xhr = new XHR();
     jest.spyOn(xhr, 'open');
     jest.spyOn(xhr, 'send');
diff --git a/src/__tests__/SingleInstanceStateController-test.js b/src/__tests__/SingleInstanceStateController-test.js
index 171f3b2..0f7e4c8 100644
--- a/src/__tests__/SingleInstanceStateController-test.js
+++ b/src/__tests__/SingleInstanceStateController-test.js
@@ -12,16 +12,19 @@ jest.dontMock('./test_helpers/flushPromises');
 
 const mockObject = function () {};
 mockObject.registerSubclass = function () {};
-jest.setMock('../ParseObject', mockObject);
+jest.setMock('../ParseObject', {
+  __esModule: true,
+  default: mockObject,
+});
 jest.useFakeTimers();
 
 const ParseFile = require('../ParseFile').default;
 const ParseGeoPoint = require('../ParseGeoPoint').default;
 const ParseOps = require('../ParseOp');
 const SingleInstanceStateController = require('../SingleInstanceStateController');
-const TaskQueue = require('../TaskQueue');
+const TaskQueue = require('../TaskQueue').default;
 const flushPromises = require('./test_helpers/flushPromises');
-const CoreManager = require('../CoreManager');
+const CoreManager = require('../CoreManager').default;
 CoreManager.setParseObject(mockObject);
 
 describe('SingleInstanceStateController', () => {
diff --git a/src/__tests__/Storage-test.js b/src/__tests__/Storage-test.js
index 8107e5b..a42b105 100644
--- a/src/__tests__/Storage-test.js
+++ b/src/__tests__/Storage-test.js
@@ -3,7 +3,7 @@ jest.autoMockOff();
 const mockRNStorageInterface = require('./test_helpers/mockRNStorage');
 const mockIndexedDB = require('./test_helpers/mockIndexedDB');
 const mockWeChat = require('./test_helpers/mockWeChat');
-const CoreManager = require('../CoreManager');
+const CoreManager = require('../CoreManager').default;
 
 global.wx = mockWeChat;
 global.indexedDB = mockIndexedDB;
@@ -12,7 +12,7 @@ jest.mock('idb-keyval', () => {
 });
 const idbKeyVal = require('idb-keyval');
 
-const BrowserStorageController = require('../StorageController.browser');
+const BrowserStorageController = require('../StorageController.browser').default;
 
 describe('Browser StorageController', () => {
   beforeEach(() => {
@@ -40,7 +40,7 @@ describe('Browser StorageController', () => {
   });
 });
 
-const RNStorageController = require('../StorageController.react-native');
+const RNStorageController = require('../StorageController.react-native').default;
 
 describe('React Native StorageController', () => {
   beforeEach(() => {
@@ -160,7 +160,7 @@ describe('IndexDB StorageController', () => {
   let IndexedDBStorageController;
   beforeEach(() => {
     jest.isolateModules(() => {
-      IndexedDBStorageController = require('../IndexedDBStorageController');
+      IndexedDBStorageController = require('../IndexedDBStorageController').default;
     });
     IndexedDBStorageController.clear();
   });
@@ -199,7 +199,7 @@ describe('IndexDB StorageController', () => {
 
   it('handle indexedDB is not defined', async () => {
     global.indexedDB = undefined;
-    const dbController = require('../IndexedDBStorageController');
+    const dbController = require('../IndexedDBStorageController').default;
     expect(dbController).toBeUndefined();
     global.indexedDB = mockIndexedDB;
   });
@@ -210,14 +210,14 @@ describe('IndexDB StorageController', () => {
       jest.spyOn(idbKeyVal, 'createStore').mockImplementationOnce(() => {
         throw new Error('Protected');
       });
-      const dbController = require('../IndexedDBStorageController');
+      const dbController = require('../IndexedDBStorageController').default;
       expect(dbController).toBeUndefined();
       expect(idbKeyVal.createStore).toHaveBeenCalled();
     });
   });
 });
 
-const DefaultStorageController = require('../StorageController.default');
+const DefaultStorageController = require('../StorageController.default').default;
 
 describe('Default StorageController', () => {
   beforeEach(() => {
@@ -245,7 +245,7 @@ describe('Default StorageController', () => {
   });
 });
 
-const WeappStorageController = require('../StorageController.weapp');
+const WeappStorageController = require('../StorageController.weapp').default;
 
 describe('WeChat StorageController', () => {
   beforeEach(() => {
@@ -274,11 +274,11 @@ describe('WeChat StorageController', () => {
   });
 });
 
-const Storage = require('../Storage');
+const Storage = require('../Storage').default;
 
 describe('Storage (Default StorageController)', () => {
   beforeEach(() => {
-    CoreManager.setStorageController(require('../StorageController.default'));
+    CoreManager.setStorageController(require('../StorageController.default').default);
   });
 
   it('can store and retrieve values', () => {
@@ -342,7 +342,7 @@ describe('Storage (Default StorageController)', () => {
 describe('Storage (Async StorageController)', () => {
   beforeEach(() => {
     CoreManager.setAsyncStorage(mockRNStorageInterface);
-    CoreManager.setStorageController(require('../StorageController.react-native'));
+    CoreManager.setStorageController(require('../StorageController.react-native').default);
   });
 
   it('throws when using a synchronous method', () => {
diff --git a/src/__tests__/TaskQueue-test.js b/src/__tests__/TaskQueue-test.js
index 10d7364..e480c8c 100644
--- a/src/__tests__/TaskQueue-test.js
+++ b/src/__tests__/TaskQueue-test.js
@@ -1,6 +1,6 @@
 jest.autoMockOff();
 
-const TaskQueue = require('../TaskQueue');
+const TaskQueue = require('../TaskQueue').default;
 const { resolvingPromise } = require('../promiseUtils');
 const flushPromises = require('./test_helpers/flushPromises');
 
diff --git a/src/__tests__/UniqueInstanceStateController-test.js b/src/__tests__/UniqueInstanceStateController-test.js
index 1c6c53f..b70145e 100644
--- a/src/__tests__/UniqueInstanceStateController-test.js
+++ b/src/__tests__/UniqueInstanceStateController-test.js
@@ -15,16 +15,19 @@ const mockObject = function (className) {
   this.className = className;
 };
 mockObject.registerSubclass = function () {};
-jest.setMock('../ParseObject', mockObject);
+jest.setMock('../ParseObject', {
+  __esModule: true,
+  default: mockObject,
+});
 
 const ParseFile = require('../ParseFile').default;
 const ParseGeoPoint = require('../ParseGeoPoint').default;
-const ParseObject = require('../ParseObject');
+const ParseObject = require('../ParseObject').default;
 const ParseOps = require('../ParseOp');
 const UniqueInstanceStateController = require('../UniqueInstanceStateController');
-const TaskQueue = require('../TaskQueue');
+const TaskQueue = require('../TaskQueue').default;
 const { resolvingPromise } = require('../promiseUtils');
-const CoreManager = require('../CoreManager');
+const CoreManager = require('../CoreManager').default;
 CoreManager.setParseObject(mockObject);
 
 describe('UniqueInstanceStateController', () => {
diff --git a/src/__tests__/arrayContainsObject-test.js b/src/__tests__/arrayContainsObject-test.js
index 3381d73..8956279 100644
--- a/src/__tests__/arrayContainsObject-test.js
+++ b/src/__tests__/arrayContainsObject-test.js
@@ -11,12 +11,17 @@ const mockObject = function (className, id) {
 mockObject.prototype._getId = function () {
   return this.id || this._localId;
 };
-jest.setMock('../ParseObject', mockObject);
+jest.setMock('../ParseObject', {
+  __esModule: true,
+  default: mockObject,
+});
 
 const arrayContainsObject = require('../arrayContainsObject').default;
-const ParseObject = require('../ParseObject');
-const CoreManager = require('../CoreManager');
-jest.spyOn(CoreManager, 'getParseObject').mockImplementation(() => require('../ParseObject'));
+const ParseObject = require('../ParseObject').default;
+const CoreManager = require('../CoreManager').default;
+jest
+  .spyOn(CoreManager, 'getParseObject')
+  .mockImplementation(() => require('../ParseObject').default);
 
 describe('arrayContainsObject', () => {
   it('detects objects by their id', () => {
diff --git a/src/__tests__/browser-test.js b/src/__tests__/browser-test.js
index 175cfec..c09decc 100644
--- a/src/__tests__/browser-test.js
+++ b/src/__tests__/browser-test.js
@@ -10,7 +10,7 @@ jest.dontMock('../Storage');
 jest.dontMock('crypto-js/aes');
 jest.setMock('../EventuallyQueue', { poll: jest.fn() });
 
-const CoreManager = require('../CoreManager');
+const CoreManager = require('../CoreManager').default;
 const ParseError = require('../ParseError').default;
 const EventuallyQueue = require('../EventuallyQueue');
 
@@ -62,11 +62,11 @@ describe('Browser', () => {
   });
 
   it('load StorageController', () => {
-    const StorageController = require('../StorageController');
+    const StorageController = require('../StorageController').default;
     CoreManager.setStorageController(StorageController);
 
     jest.spyOn(StorageController, 'setItem');
-    const storage = require('../Storage');
+    const storage = require('../Storage').default;
     storage.setItem('key', 'value');
     expect(StorageController.setItem).toHaveBeenCalledTimes(1);
   });
@@ -84,7 +84,7 @@ describe('Browser', () => {
       }
     }
     global.XDomainRequest = XDomainRequest;
-    const RESTController = require('../RESTController');
+    const RESTController = require('../RESTController').default;
     const options = {
       progress: () => {},
       requestTask: () => {},
@@ -114,7 +114,7 @@ describe('Browser', () => {
     class XMLHttpRequest {}
     global.XDomainRequest = XDomainRequest;
     global.XMLHttpRequest = XMLHttpRequest;
-    const RESTController = require('../RESTController');
+    const RESTController = require('../RESTController').default;
     try {
       await RESTController.ajax('POST', 'classes/TestObject');
       expect(true).toBe(false);
@@ -142,7 +142,7 @@ describe('Browser', () => {
     class XMLHttpRequest {}
     global.XDomainRequest = XDomainRequest;
     global.XMLHttpRequest = XMLHttpRequest;
-    const RESTController = require('../RESTController');
+    const RESTController = require('../RESTController').default;
     try {
       await RESTController.ajax('POST', 'classes/TestObject');
       expect(true).toBe(false);
diff --git a/src/__tests__/canBeSerialized-test.js b/src/__tests__/canBeSerialized-test.js
index c65fddd..c6bd8aa 100644
--- a/src/__tests__/canBeSerialized-test.js
+++ b/src/__tests__/canBeSerialized-test.js
@@ -6,8 +6,11 @@ function mockObject(id, attributes) {
   this.attributes = attributes;
 }
 mockObject.registerSubclass = function () {};
-jest.setMock('../ParseObject', mockObject);
-const CoreManager = require('../CoreManager');
+jest.setMock('../ParseObject', {
+  __esModule: true,
+  default: mockObject,
+});
+const CoreManager = require('../CoreManager').default;
 CoreManager.setParseObject(mockObject);
 
 function mockFile(url) {
@@ -16,11 +19,14 @@ function mockFile(url) {
 mockFile.prototype.url = function () {
   return this._url;
 };
-jest.setMock('../ParseFile', mockFile);
+jest.setMock('../ParseFile', {
+  __esModule: true,
+  default: mockFile,
+});
 
 const canBeSerialized = require('../canBeSerialized').default;
-const ParseFile = require('../ParseFile');
-const ParseObject = require('../ParseObject');
+const ParseFile = require('../ParseFile').default;
+const ParseObject = require('../ParseObject').default;
 const ParseRelation = require('../ParseRelation').default;
 
 describe('canBeSerialized', () => {
diff --git a/src/__tests__/encode-test.js b/src/__tests__/encode-test.js
index 6cf1d14..5760031 100644
--- a/src/__tests__/encode-test.js
+++ b/src/__tests__/encode-test.js
@@ -38,15 +38,18 @@ mockObject.prototype = {
     return json;
   },
 };
-jest.setMock('../ParseObject', mockObject);
+jest.setMock('../ParseObject', {
+  __esModule: true,
+  default: mockObject,
+});
 
 const encode = require('../encode').default;
 const ParseACL = require('../ParseACL').default;
 const ParseFile = require('../ParseFile').default;
 const ParseGeoPoint = require('../ParseGeoPoint').default;
-const ParseObject = require('../ParseObject');
+const ParseObject = require('../ParseObject').default;
 const ParseRelation = require('../ParseRelation').default;
-const CoreManager = require('../CoreManager');
+const CoreManager = require('../CoreManager').default;
 CoreManager.setParseObject(mockObject);
 CoreManager.setParseOp(require('../ParseOp'));
 CoreManager.setParseUser(require('../ParseUser').default);
diff --git a/src/__tests__/react-native-test.js b/src/__tests__/react-native-test.js
index 7316847..521b37f 100644
--- a/src/__tests__/react-native-test.js
+++ b/src/__tests__/react-native-test.js
@@ -25,7 +25,7 @@ jest.mock(
 );
 
 const mockEmitter = require('react-native/Libraries/vendor/emitter/EventEmitter').default;
-const CoreManager = require('../CoreManager');
+const CoreManager = require('../CoreManager').default;
 
 describe('React Native', () => {
   beforeEach(() => {
@@ -37,8 +37,8 @@ describe('React Native', () => {
   });
 
   it('load EventEmitter', () => {
-    const eventEmitter = require('../EventEmitter');
-    expect(eventEmitter).toEqual(mockEmitter);
+    const EventEmitter = require('../EventEmitter').default;
+    expect(EventEmitter).toEqual(mockEmitter);
   });
 
   it('load CryptoController', () => {
@@ -48,31 +48,31 @@ describe('React Native', () => {
         toString: () => 'World',
       };
     });
-    const CryptoController = require('../CryptoController');
+    const CryptoController = require('../CryptoController').default;
     const phrase = CryptoController.encrypt({}, 'salt');
     expect(phrase).toBe('World');
     expect(CryptoJS.AES.encrypt).toHaveBeenCalled();
   });
 
   it('load LocalDatastoreController', () => {
-    const LocalDatastoreController = require('../LocalDatastoreController');
+    const LocalDatastoreController = require('../LocalDatastoreController').default;
     require('../LocalDatastore');
     const LDC = CoreManager.getLocalDatastoreController();
     expect(LocalDatastoreController).toEqual(LDC);
   });
 
   it('load StorageController', () => {
-    const StorageController = require('../StorageController');
+    const StorageController = require('../StorageController').default;
     CoreManager.setStorageController(StorageController);
 
     jest.spyOn(StorageController, 'setItemAsync');
-    const storage = require('../Storage');
+    const storage = require('../Storage').default;
     storage.setItemAsync('key', 'value');
     expect(StorageController.setItemAsync).toHaveBeenCalledTimes(1);
   });
 
   it('load WebSocketController', () => {
-    const WebSocketController = require('../WebSocketController');
+    const WebSocketController = require('../WebSocketController').default;
     CoreManager.setWebSocketController(WebSocketController);
 
     jest.mock('../EventEmitter', () => {
diff --git a/src/__tests__/unique-test.js b/src/__tests__/unique-test.js
index 2d38552..ff22511 100644
--- a/src/__tests__/unique-test.js
+++ b/src/__tests__/unique-test.js
@@ -12,12 +12,17 @@ const mockObject = function (className, id) {
 mockObject.prototype._getId = function () {
   return this.id || this._localId;
 };
-jest.setMock('../ParseObject', mockObject);
+jest.setMock('../ParseObject', {
+  __esModule: true,
+  default: mockObject,
+});
 
 const unique = require('../unique').default;
-const ParseObject = require('../ParseObject');
-const CoreManager = require('../CoreManager');
-jest.spyOn(CoreManager, 'getParseObject').mockImplementation(() => require('../ParseObject'));
+const ParseObject = require('../ParseObject').default;
+const CoreManager = require('../CoreManager').default;
+jest
+  .spyOn(CoreManager, 'getParseObject')
+  .mockImplementation(() => require('../ParseObject').default);
 
 describe('unique', () => {
   it('produces an array with unique elements', () => {
diff --git a/src/__tests__/unsavedChildren-test.js b/src/__tests__/unsavedChildren-test.js
index f85a0c7..44ca755 100644
--- a/src/__tests__/unsavedChildren-test.js
+++ b/src/__tests__/unsavedChildren-test.js
@@ -18,12 +18,15 @@ mockObject.prototype = {
     return this._dirty;
   },
 };
-jest.setMock('../ParseObject', mockObject);
-const CoreManager = require('../CoreManager');
+jest.setMock('../ParseObject', {
+  __esModule: true,
+  default: mockObject,
+});
+const CoreManager = require('../CoreManager').default;
 CoreManager.setParseObject(mockObject);
 
 const ParseFile = require('../ParseFile').default;
-const ParseObject = require('../ParseObject');
+const ParseObject = require('../ParseObject').default;
 const ParseRelation = require('../ParseRelation').default;
 const unsavedChildren = require('../unsavedChildren').default;
 
diff --git a/src/__tests__/weapp-test.js b/src/__tests__/weapp-test.js
index c693d08..d1ef521 100644
--- a/src/__tests__/weapp-test.js
+++ b/src/__tests__/weapp-test.js
@@ -15,7 +15,7 @@ jest.dontMock('../uuid');
 jest.dontMock('crypto-js/aes');
 jest.dontMock('./test_helpers/mockWeChat');
 
-const CoreManager = require('../CoreManager');
+const CoreManager = require('../CoreManager').default;
 const mockWeChat = require('./test_helpers/mockWeChat');
 
 global.wx = mockWeChat;
@@ -34,22 +34,22 @@ describe('WeChat', () => {
   });
 
   it('load StorageController', () => {
-    const StorageController = require('../StorageController');
+    const StorageController = require('../StorageController').default;
     CoreManager.setStorageController(StorageController);
     jest.spyOn(StorageController, 'setItem');
-    const storage = require('../Storage');
+    const storage = require('../Storage').default;
     storage.setItem('key', 'value');
     expect(StorageController.setItem).toHaveBeenCalledTimes(1);
   });
 
   it('load RESTController', () => {
-    const XHR = require('../Xhr.weapp');
-    const RESTController = require('../RESTController');
+    const XHR = require('../Xhr.weapp').default;
+    const RESTController = require('../RESTController').default;
     expect(RESTController._getXHR()).toEqual(XHR);
   });
 
   it('load ParseFile', () => {
-    const XHR = require('../Xhr.weapp');
+    const XHR = require('../Xhr.weapp').default;
     require('../ParseFile');
     const fileController = CoreManager.getFileController();
     expect(fileController._getXHR()).toEqual(XHR);
@@ -65,14 +65,14 @@ describe('WeChat', () => {
   });
 
   it('load uuid module', () => {
-    const uuidv4 = require('../uuid');
+    const uuidv4 = require('../uuid').default;
     expect(uuidv4()).not.toEqual(0);
     expect(uuidv4()).not.toEqual(uuidv4());
   });
 
   describe('Socket', () => {
     it('send', () => {
-      const Websocket = require('../Socket.weapp');
+      const Websocket = require('../Socket.weapp').default;
       jest.spyOn(mockWeChat, 'connectSocket');
       const socket = new Websocket('wss://examples.com');
       socket.onopen();