disable automock by default in as many places as possible @bypass-lint

Reviewed By: cpojer

Differential Revision: D5190858

fbshipit-source-id: d3125cf81427dbbe3362ef1f958413394a6dc51d
This commit is contained in:
James Burnett 2017-06-08 07:36:21 -07:00 committed by Facebook Github Bot
parent ba2e486b33
commit 3360999431
34 changed files with 39 additions and 45 deletions

View File

@ -8,7 +8,7 @@
*/ */
'use strict'; 'use strict';
jest.unmock('Easing'); jest.disableAutomock();
var Easing = require('Easing'); var Easing = require('Easing');
describe('Easing', () => { describe('Easing', () => {

View File

@ -8,10 +8,7 @@
*/ */
'use strict'; 'use strict';
jest jest.disableAutomock();
.unmock('Interpolation')
.unmock('Easing')
.unmock('normalizeColor');
var Interpolation = require('Interpolation'); var Interpolation = require('Interpolation');
var Easing = require('Easing'); var Easing = require('Easing');

View File

@ -10,7 +10,7 @@
'use strict'; 'use strict';
jest.unmock('bezier'); jest.disableAutomock();
var bezier = require('bezier'); var bezier = require('bezier');
var identity = function (x) { return x; }; var identity = function (x) { return x; };

View File

@ -10,8 +10,7 @@
'use strict'; 'use strict';
// const MessageQueueTestConfig = require('MessageQueueTestConfig'); // const MessageQueueTestConfig = require('MessageQueueTestConfig');
jest.unmock('MessageQueue'); jest.disableAutomock();
jest.unmock('defineLazyObjectProperty');
let MessageQueue; let MessageQueue;
let MessageQueueTestModule; let MessageQueueTestModule;

View File

@ -9,10 +9,12 @@
*/ */
'use strict'; 'use strict';
jest.unmock('BatchedBridge'); jest
jest.unmock('defineLazyObjectProperty'); .enableAutomock()
jest.unmock('MessageQueue'); .unmock('BatchedBridge')
jest.unmock('NativeModules'); .unmock('defineLazyObjectProperty')
.unmock('MessageQueue')
.unmock('NativeModules');
let BatchedBridge; let BatchedBridge;
let NativeModules; let NativeModules;

View File

@ -8,11 +8,7 @@
*/ */
'use strict'; 'use strict';
jest jest.disableAutomock();
.unmock('AssetRegistry')
.unmock('AssetSourceResolver')
.unmock('../resolveAssetSource')
.unmock('../../../local-cli/bundle/assetPathUtils');
var AssetRegistry = require('AssetRegistry'); var AssetRegistry = require('AssetRegistry');
var Platform = require('Platform'); var Platform = require('Platform');

View File

@ -9,7 +9,7 @@
*/ */
'use strict'; 'use strict';
jest.unmock('InteractionMixin'); jest.enableAutomock().unmock('InteractionMixin');
describe('InteractionMixin', () => { describe('InteractionMixin', () => {
var InteractionManager; var InteractionManager;

View File

@ -10,7 +10,7 @@
'use strict'; 'use strict';
jest.unmock('TaskQueue'); jest.disableAutomock();
function expectToBeCalledOnce(fn) { function expectToBeCalledOnce(fn) {
expect(fn.mock.calls.length).toBe(1); expect(fn.mock.calls.length).toBe(1);

View File

@ -9,7 +9,7 @@
*/ */
'use strict'; 'use strict';
jest.unmock('FillRateHelper'); jest.disableAutomock();
const FillRateHelper = require('FillRateHelper'); const FillRateHelper = require('FillRateHelper');

View File

@ -9,7 +9,7 @@
*/ */
'use strict'; 'use strict';
jest.unmock('ViewabilityHelper'); jest.disableAutomock();
const ViewabilityHelper = require('ViewabilityHelper'); const ViewabilityHelper = require('ViewabilityHelper');

View File

@ -9,7 +9,7 @@
*/ */
'use strict'; 'use strict';
jest.unmock('VirtualizeUtils'); jest.disableAutomock();
const { elementsThatOverlapOffsets, newRangeCount } = require('VirtualizeUtils'); const { elementsThatOverlapOffsets, newRangeCount } = require('VirtualizeUtils');

View File

@ -9,7 +9,7 @@
'use strict'; 'use strict';
jest.unmock('FormData'); jest.disableAutomock();
const FormData = require('FormData'); const FormData = require('FormData');

View File

@ -8,7 +8,7 @@
*/ */
'use strict'; 'use strict';
jest.unmock('normalizeColor'); jest.disableAutomock();
var normalizeColor = require('normalizeColor'); var normalizeColor = require('normalizeColor');

View File

@ -8,8 +8,7 @@
*/ */
'use strict'; 'use strict';
jest.unmock('setNormalizedColorAlpha'); jest.disableAutomock();
jest.unmock('normalizeColor');
var setNormalizedColorAlpha = require('setNormalizedColorAlpha'); var setNormalizedColorAlpha = require('setNormalizedColorAlpha');
var normalizeColor = require('normalizeColor'); var normalizeColor = require('normalizeColor');

View File

@ -8,8 +8,7 @@
*/ */
'use strict'; 'use strict';
jest.unmock('MatrixMath'); jest.disableAutomock();
jest.unmock('fbjs/lib/invariant');
var MatrixMath = require('MatrixMath'); var MatrixMath = require('MatrixMath');

View File

@ -8,8 +8,7 @@
*/ */
'use strict'; 'use strict';
jest.unmock('../Platform.ios'); jest.disableAutomock();
jest.unmock('../Platform.android');
var PlatformIOS = require('../Platform.ios'); var PlatformIOS = require('../Platform.ios');
var PlatformAndroid = require('../Platform.android'); var PlatformAndroid = require('../Platform.android');

View File

@ -9,7 +9,7 @@
*/ */
'use strict'; 'use strict';
jest.unmock('SceneTracker'); jest.disableAutomock();
const SceneTracker = require('SceneTracker'); const SceneTracker = require('SceneTracker');

View File

@ -9,7 +9,7 @@
*/ */
'use strict'; 'use strict';
jest.unmock('buildStyleInterpolator'); jest.disableAutomock();
var buildStyleInterpolator = require('buildStyleInterpolator'); var buildStyleInterpolator = require('buildStyleInterpolator');

View File

@ -7,7 +7,7 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
* *
*/ */
jest.unmock('deepFreezeAndThrowOnMutationInDev'); jest.disableAutomock();
var deepFreezeAndThrowOnMutationInDev = require('deepFreezeAndThrowOnMutationInDev'); var deepFreezeAndThrowOnMutationInDev = require('deepFreezeAndThrowOnMutationInDev');
describe('deepFreezeAndThrowOnMutationInDev', function() { describe('deepFreezeAndThrowOnMutationInDev', function() {

View File

@ -9,7 +9,7 @@
*/ */
'use strict'; 'use strict';
jest.unmock('groupByEveryN'); jest.disableAutomock();
describe('groupByEveryN', () => { describe('groupByEveryN', () => {
var groupByEveryN = require('groupByEveryN'); var groupByEveryN = require('groupByEveryN');

View File

@ -8,7 +8,7 @@
*/ */
'use strict'; 'use strict';
jest.unmock('mapWithSeparator'); jest.disableAutomock();
describe('mapWithSeparator', () => { describe('mapWithSeparator', () => {
const mapWithSeparator = require('mapWithSeparator'); const mapWithSeparator = require('mapWithSeparator');

View File

@ -9,7 +9,7 @@
*/ */
'use strict'; 'use strict';
jest.unmock('truncate'); jest.disableAutomock();
describe('truncate', () => { describe('truncate', () => {

View File

@ -8,7 +8,7 @@
*/ */
'use strict'; 'use strict';
jest.unmock('deepDiffer'); jest.disableAutomock();
var deepDiffer = require('deepDiffer'); var deepDiffer = require('deepDiffer');
describe('deepDiffer', function() { describe('deepDiffer', function() {

View File

@ -3,7 +3,7 @@
*/ */
'use strict'; 'use strict';
jest.unmock('WebSocket'); jest.enableAutomock().unmock('WebSocket');
jest.setMock('NativeModules', { jest.setMock('NativeModules', {
WebSocketModule: { WebSocketModule: {
connect: () => {} connect: () => {}

View File

@ -8,7 +8,7 @@
*/ */
'use strict'; 'use strict';
jest jest.disableAutomock()
.dontMock('../filterPlatformAssetScales') .dontMock('../filterPlatformAssetScales')
.dontMock('../assetPathUtils'); .dontMock('../assetPathUtils');

View File

@ -8,7 +8,7 @@
*/ */
'use strict'; 'use strict';
jest jest.disableAutomock()
.dontMock('../getAssetDestPathAndroid') .dontMock('../getAssetDestPathAndroid')
.dontMock('../assetPathUtils'); .dontMock('../assetPathUtils');

View File

@ -8,7 +8,7 @@
*/ */
'use strict'; 'use strict';
jest.dontMock('../getAssetDestPathIOS'); jest.disableAutomock().dontMock('../getAssetDestPathIOS');
const getAssetDestPathIOS = require('../getAssetDestPathIOS'); const getAssetDestPathIOS = require('../getAssetDestPathIOS');

View File

@ -1,3 +1,4 @@
jest.disableAutomock();
var spawnError = false; var spawnError = false;
jest.setMock('child_process', { jest.setMock('child_process', {

View File

@ -9,7 +9,7 @@
*/ */
'use strict'; 'use strict';
jest.dontMock('../findMatchingSimulator'); jest.disableAutomock().dontMock('../findMatchingSimulator');
const findMatchingSimulator = require('../findMatchingSimulator'); const findMatchingSimulator = require('../findMatchingSimulator');

View File

@ -8,7 +8,7 @@
*/ */
'use strict'; 'use strict';
jest.dontMock('../findXcodeProject'); jest.disableAutomock().dontMock('../findXcodeProject');
const findXcodeProject = require('../findXcodeProject'); const findXcodeProject = require('../findXcodeProject');

View File

@ -9,7 +9,7 @@
'use strict'; 'use strict';
jest.dontMock('../parseIOSDevicesList'); jest.disableAutomock().dontMock('../parseIOSDevicesList');
var parseIOSDevicesList = require('../parseIOSDevicesList'); var parseIOSDevicesList = require('../parseIOSDevicesList');
describe('parseIOSDevicesList', () => { describe('parseIOSDevicesList', () => {

View File

@ -8,7 +8,7 @@
*/ */
'use strict'; 'use strict';
jest.dontMock('../getInverseDependencies'); jest.disableAutomock().dontMock('../getInverseDependencies');
const getInverseDependencies = require('../getInverseDependencies'); const getInverseDependencies = require('../getInverseDependencies');

View File

@ -1,3 +1,4 @@
jest.disableAutomock();
import 'react-native'; import 'react-native';
import React from 'react'; import React from 'react';
import Index from '../index.android.js'; import Index from '../index.android.js';

View File

@ -1,3 +1,4 @@
jest.disableAutomock();
import 'react-native'; import 'react-native';
import React from 'react'; import React from 'react';
import Index from '../index.ios.js'; import Index from '../index.ios.js';