remove disableAutomock from jest tests (new default) @bypass-lint

Reviewed By: cpojer

Differential Revision: D5237192

fbshipit-source-id: dccca52a91259d7fea27931f92bca94184a82d4a
This commit is contained in:
James Burnett 2017-06-13 15:01:42 -07:00 committed by Facebook Github Bot
parent 7707905550
commit 51c0e81557
86 changed files with 52 additions and 200 deletions

View File

@ -8,8 +8,6 @@
*/
'use strict';
jest.disableAutomock();
var Animated = require('Animated');
describe('Animated tests', () => {
beforeEach(() => {

View File

@ -9,7 +9,6 @@
'use strict';
jest
.disableAutomock()
.setMock('Text', {})
.setMock('View', {})
.setMock('Image', {})

View File

@ -8,8 +8,6 @@
*/
'use strict';
jest.disableAutomock();
var Easing = require('Easing');
describe('Easing', () => {
it('should work with linear', () => {

View File

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

View File

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

View File

@ -9,9 +9,6 @@
*/
'use strict';
// const MessageQueueTestConfig = require('MessageQueueTestConfig');
jest.disableAutomock();
let MessageQueue;
let MessageQueueTestModule;
let queue;

View File

@ -8,8 +8,6 @@
*/
'use strict';
jest.disableAutomock();
const React = require('React');
const ReactTestRenderer = require('react-test-renderer');
const Text = require('Text');

View File

@ -9,8 +9,6 @@
'use strict';
jest.disableAutomock();
var parseErrorStack = require('parseErrorStack');
function getFakeError() {

View File

@ -8,8 +8,6 @@
*/
'use strict';
jest.disableAutomock();
var AssetRegistry = require('AssetRegistry');
var Platform = require('Platform');
var NativeModules = require('NativeModules');

View File

@ -11,7 +11,6 @@
'use strict';
jest
.disableAutomock()
.mock('ErrorUtils')
.mock('BatchedBridge');

View File

@ -11,7 +11,6 @@
'use strict';
jest
.disableAutomock()
.mock('ErrorUtils')
.mock('BatchedBridge');

View File

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

View File

@ -11,8 +11,6 @@
*/
'use strict';
jest.disableAutomock();
const FillRateHelper = require('FillRateHelper');
let rowFramesGlobal;

View File

@ -11,8 +11,6 @@
*/
'use strict';
jest.disableAutomock();
const React = require('React');
const ReactTestRenderer = require('react-test-renderer');

View File

@ -11,8 +11,6 @@
*/
'use strict';
jest.disableAutomock();
const React = require('React');
const ReactTestRenderer = require('react-test-renderer');

View File

@ -11,8 +11,6 @@
*/
'use strict';
jest.disableAutomock();
const ViewabilityHelper = require('ViewabilityHelper');
let rowFrames;

View File

@ -11,8 +11,6 @@
*/
'use strict';
jest.disableAutomock();
const {elementsThatOverlapOffsets, newRangeCount} = require('VirtualizeUtils');
describe('newRangeCount', function() {

View File

@ -11,8 +11,6 @@
*/
'use strict';
jest.disableAutomock();
const React = require('React');
const ReactTestRenderer = require('react-test-renderer');

View File

@ -9,8 +9,6 @@
'use strict';
jest.disableAutomock();
const FormData = require('FormData');
describe('FormData', function() {

View File

@ -20,7 +20,6 @@ function setRequestId(id){
}
jest
.disableAutomock()
.dontMock('event-target-shim')
.setMock('NativeModules', {
Networking: {

View File

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

View File

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

View File

@ -8,8 +8,6 @@
*/
'use strict';
jest.disableAutomock();
const {OS} = require('Platform');
const processColor = require('processColor');

View File

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

View File

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

View File

@ -8,8 +8,6 @@
*/
'use strict';
jest.disableAutomock();
var MatrixMath = require('MatrixMath');
function degreesToRadians(degrees) {

View File

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

View File

@ -9,8 +9,6 @@
*/
'use strict';
jest.disableAutomock();
const SceneTracker = require('SceneTracker');
describe('setActiveScene', function() {

View File

@ -9,8 +9,6 @@
*/
'use strict';
jest.disableAutomock();
var buildStyleInterpolator = require('buildStyleInterpolator');
var validateEmpty = function(interpolator, value, validator) {

View File

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

View File

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

View File

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

View File

@ -9,8 +9,6 @@
*/
'use strict';
jest.disableAutomock();
describe('truncate', () => {
var truncate = require('truncate');

View File

@ -7,57 +7,55 @@
* of patent rights can be found in the PATENTS file in the same directory.
*/
'use strict';
'use strict';
jest.disableAutomock();
const {encode} = require('../utf8');
const {encode} = require('../utf8');
describe('UTF-8 encoding:', () => {
it('can encode code points < U+80', () => {
const arrayBuffer = encode('\u0000abcDEF\u007f');
expect(new Uint8Array(arrayBuffer)).toEqual(
new Uint8Array([0x00, 0x61, 0x62, 0x63, 0x44, 0x45, 0x46, 0x7f]));
});
describe('UTF-8 encoding:', () => {
it('can encode code points < U+80', () => {
const arrayBuffer = encode('\u0000abcDEF\u007f');
expect(new Uint8Array(arrayBuffer)).toEqual(
new Uint8Array([0x00, 0x61, 0x62, 0x63, 0x44, 0x45, 0x46, 0x7f]));
});
it('can encode code points < U+800', () => {
const arrayBuffer = encode('\u0080\u0548\u07ff');
expect(new Uint8Array(arrayBuffer)).toEqual(
new Uint8Array([0xc2, 0x80, 0xd5, 0x88, 0xdf, 0xbf]));
});
it('can encode code points < U+800', () => {
const arrayBuffer = encode('\u0080\u0548\u07ff');
expect(new Uint8Array(arrayBuffer)).toEqual(
new Uint8Array([0xc2, 0x80, 0xd5, 0x88, 0xdf, 0xbf]));
});
it('can encode code points < U+10000', () => {
const arrayBuffer = encode('\u0800\uac48\uffff');
expect(new Uint8Array(arrayBuffer)).toEqual(
new Uint8Array([0xe0, 0xa0, 0x80, 0xea, 0xb1, 0x88, 0xef, 0xbf, 0xbf]));
});
it('can encode code points < U+10000', () => {
const arrayBuffer = encode('\u0800\uac48\uffff');
expect(new Uint8Array(arrayBuffer)).toEqual(
new Uint8Array([0xe0, 0xa0, 0x80, 0xea, 0xb1, 0x88, 0xef, 0xbf, 0xbf]));
});
it('can encode code points in the Supplementary Planes (surrogate pairs)', () => {
const arrayBuffer = encode([
'\ud800\udc00',
'\ud800\ude89',
'\ud83d\ude3b',
'\udbff\udfff'
].join(''));
expect(new Uint8Array(arrayBuffer)).toEqual(
new Uint8Array([
0xf0, 0x90, 0x80, 0x80,
0xf0, 0x90, 0x8a, 0x89,
0xf0, 0x9f, 0x98, 0xbb,
0xf4, 0x8f, 0xbf, 0xbf,
])
);
});
it('can encode code points in the Supplementary Planes (surrogate pairs)', () => {
const arrayBuffer = encode([
'\ud800\udc00',
'\ud800\ude89',
'\ud83d\ude3b',
'\udbff\udfff'
].join(''));
expect(new Uint8Array(arrayBuffer)).toEqual(
new Uint8Array([
0xf0, 0x90, 0x80, 0x80,
0xf0, 0x90, 0x8a, 0x89,
0xf0, 0x9f, 0x98, 0xbb,
0xf4, 0x8f, 0xbf, 0xbf,
])
);
});
it('allows for stray high surrogates', () => {
const arrayBuffer = encode(String.fromCharCode(0x61, 0xd8c6, 0x62));
expect(new Uint8Array(arrayBuffer)).toEqual(
new Uint8Array([0x61, 0xed, 0xa3, 0x86, 0x62]));
});
it('allows for stray high surrogates', () => {
const arrayBuffer = encode(String.fromCharCode(0x61, 0xd8c6, 0x62));
expect(new Uint8Array(arrayBuffer)).toEqual(
new Uint8Array([0x61, 0xed, 0xa3, 0x86, 0x62]));
});
it('allows for stray low surrogates', () => {
const arrayBuffer = encode(String.fromCharCode(0x61, 0xde19, 0x62));
expect(new Uint8Array(arrayBuffer)).toEqual(
new Uint8Array([0x61, 0xed, 0xb8, 0x99, 0x62]));
});
});
it('allows for stray low surrogates', () => {
const arrayBuffer = encode(String.fromCharCode(0x61, 0xde19, 0x62));
expect(new Uint8Array(arrayBuffer)).toEqual(
new Uint8Array([0x61, 0xed, 0xb8, 0x99, 0x62]));
});
});

View File

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

View File

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

View File

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

View File

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

View File

@ -11,8 +11,6 @@
'use strict';
jest.autoMockOff();
const findAndroidAppFolder = require('../../android/findAndroidAppFolder');
const mockFS = require('mock-fs');
const mocks = require('../../__fixtures__/android');

View File

@ -11,8 +11,6 @@
'use strict';
jest.autoMockOff();
require('../../__fixtures__/mockFSWorkaround');
const findManifest = require('../../android/findManifest');

View File

@ -11,8 +11,6 @@
'use strict';
jest.autoMockOff();
require('../../__fixtures__/mockFSWorkaround');
const findPackageClassName = require('../../android/findPackageClassName');

View File

@ -11,8 +11,6 @@
'use strict';
jest.autoMockOff();
require('../../__fixtures__/mockFSWorkaround');
const getDependencyConfig = require('../../android').dependencyConfig;

View File

@ -11,8 +11,6 @@
'use strict';
jest.autoMockOff();
require('../../__fixtures__/mockFSWorkaround');
const getProjectConfig = require('../../android').projectConfig;

View File

@ -11,8 +11,6 @@
'use strict';
jest.autoMockOff();
require('../../__fixtures__/mockFSWorkaround');
const findManifest = require('../../android/findManifest');

View File

@ -11,8 +11,6 @@
'use strict';
jest.autoMockOff();
const findAssets = require('../findAssets');
const dependencies = require('../__fixtures__/dependencies');
const mockFs = require('mock-fs');

View File

@ -11,8 +11,6 @@
'use strict';
jest.autoMockOff();
const findPlugins = require('../findPlugins');
const path = require('path');

View File

@ -11,8 +11,6 @@
'use strict';
jest.autoMockOff();
require('../../__fixtures__/mockFSWorkaround');
const findProject = require('../../ios/findProject');

View File

@ -11,8 +11,6 @@
'use strict';
jest.autoMockOff();
require('../../__fixtures__/mockFSWorkaround');
const getProjectConfig = require('../../ios').projectConfig;

View File

@ -11,8 +11,6 @@
'use strict';
jest.autoMockOff();
let spawnError = false;
jest.setMock('child_process', {

View File

@ -9,8 +9,6 @@
'use strict';
jest.autoMockOff();
const applyParams = require('../../android/patches/applyParams');
describe('applyParams', () => {

View File

@ -1,7 +1,5 @@
'use strict';
jest.autoMockOff();
const path = require('path');
const isInstalled = require('../../android/isInstalled');

View File

@ -1,7 +1,5 @@
'use strict';
jest.autoMockOff();
const makeBuildPatch = require('../../android/patches/makeBuildPatch');
const name = 'test';

View File

@ -1,7 +1,5 @@
'use strict';
jest.autoMockOff();
const makeImportPatch = require('../../android/patches/makeImportPatch');
const packageImportPath = 'import some.example.project';

View File

@ -1,7 +1,5 @@
'use strict';
jest.autoMockOff();
const makePackagePatch = require('../../android/patches/makePackagePatch');
const applyParams = require('../../android/patches/applyParams');

View File

@ -1,7 +1,5 @@
'use strict';
jest.autoMockOff();
const path = require('path');
const makeSettingsPatch = require('../../android/patches/makeSettingsPatch');

View File

@ -1,7 +1,5 @@
'use strict';
jest.autoMockOff();
const makeStringsPatch = require('../../android/patches/makeStringsPatch');
describe('makeStringsPatch', () => {

View File

@ -1,7 +1,5 @@
'use strict';
jest.autoMockOff();
const getDependencyConfig = require('../getDependencyConfig');
const sinon = require('sinon');

View File

@ -9,8 +9,6 @@
'use strict';
jest.autoMockOff();
const getProjectDependencies = require('../getProjectDependencies');
const path = require('path');

View File

@ -1,7 +1,5 @@
'use strict';
jest.autoMockOff();
const groupFilesByType = require('../groupFilesByType');
describe('groupFilesByType', () => {

View File

@ -1,7 +1,5 @@
'use strict';
jest.autoMockOff();
const xcode = require('xcode');
const path = require('path');
const addFileToProject = require('../../ios/addFileToProject');

View File

@ -1,7 +1,5 @@
'use strict';
jest.autoMockOff();
const xcode = require('xcode');
const path = require('path');
const PbxFile = require('xcode/lib/pbxFile');

View File

@ -1,7 +1,5 @@
'use strict';
jest.autoMockOff();
const xcode = require('xcode');
const path = require('path');
const addSharedLibraries = require('../../ios/addSharedLibraries');

View File

@ -1,7 +1,5 @@
'use strict';
jest.autoMockOff();
const xcode = require('xcode');
const path = require('path');
const createGroup = require('../../ios/createGroup');

View File

@ -1,7 +1,5 @@
'use strict';
jest.autoMockOff();
const xcode = require('xcode');
const path = require('path');
const getBuildProperty = require('../../ios/getBuildProperty');

View File

@ -1,7 +1,5 @@
'use strict';
jest.autoMockOff();
const xcode = require('xcode');
const getGroup = require('../../ios/getGroup');
const path = require('path');

View File

@ -1,7 +1,5 @@
'use strict';
jest.autoMockOff();
const getHeaderSearchPath = require('../../ios/getHeaderSearchPath');
const path = require('path');

View File

@ -1,7 +1,5 @@
'use strict';
jest.autoMockOff();
const getHeadersInFolder = require('../../ios/getHeadersInFolder');
describe('ios::getHeadersInFolder', () => {

View File

@ -1,7 +1,5 @@
'use strict';
jest.autoMockOff();
const xcode = require('xcode');
const getPlist = require('../../ios/getPlist');
const path = require('path');

View File

@ -1,7 +1,5 @@
'use strict';
jest.autoMockOff();
const xcode = require('xcode');
const getPlistPath = require('../../ios/getPlistPath');
const path = require('path');

View File

@ -1,7 +1,5 @@
'use strict';
jest.autoMockOff();
const xcode = require('xcode');
const getProducts = require('../../ios/getProducts');
const path = require('path');

View File

@ -1,7 +1,5 @@
'use strict';
jest.autoMockOff();
const xcode = require('xcode');
const hasLibraryImported = require('../../ios/hasLibraryImported');
const path = require('path');

View File

@ -1,7 +1,5 @@
'use strict';
jest.autoMockOff();
const path = require('path');
const isInstalled = require('../../ios/isInstalled');

View File

@ -1,7 +1,5 @@
'use strict';
jest.autoMockOff();
const xcode = require('xcode');
const mapHeaderSearchPaths = require('../../ios/mapHeaderSearchPaths');
const path = require('path');

View File

@ -1,7 +1,5 @@
'use strict';
jest.autoMockOff();
const xcode = require('xcode');
const PbxFile = require('xcode/lib/pbxFile');
const addProjectToLibraries = require('../../ios/addProjectToLibraries');

View File

@ -1,7 +1,5 @@
'use strict';
jest.autoMockOff();
const xcode = require('xcode');
const pbxFile = require('xcode/lib/pbxFile');
const addFileToProject = require('../../ios/addFileToProject');

View File

@ -1,7 +1,5 @@
'use strict';
jest.autoMockOff();
const xcode = require('xcode');
const path = require('path');
const addSharedLibraries = require('../../ios/addSharedLibraries');

View File

@ -9,7 +9,6 @@
'use strict';
jest.autoMockOff();
jest.mock('fs');
let plistPath = null;

View File

@ -9,8 +9,6 @@
'use strict';
jest.autoMockOff();
const sinon = require('sinon');
const log = require('npmlog');
const path = require('path');

View File

@ -1,7 +1,5 @@
'use strict';
jest.autoMockOff();
const sinon = require('sinon');
const promiseWaterfall = require('../promiseWaterfall');

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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