RN: Node v8 Workaround for `local-cli/core/__tests__`

Reviewed By: raluca-elena

Differential Revision: D5224358

fbshipit-source-id: 66c923bd3a38af47fcacbd1ee758bd28253ecf31
This commit is contained in:
Tim Yung 2017-06-09 23:56:06 -07:00 committed by Facebook Github Bot
parent 223eab930b
commit 6407071424
11 changed files with 41 additions and 12 deletions

View File

@ -0,0 +1,24 @@
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @format
*/
'use strict';
const fs = require('fs');
const mockFS = require('mock-fs');
/**
* @see https://github.com/tschaub/mock-fs/issues/208
*/
mockFS();
if (!fs.statSync(process.cwd()).isDirectory()) {
test.only('skipping tests because of mock-fs bug in Node v8.x.x', () => {});
}
mockFS.restore();

View File

@ -13,9 +13,8 @@
jest.autoMockOff(); jest.autoMockOff();
const mockFS = require('mock-fs');
const findAndroidAppFolder = require('../../android/findAndroidAppFolder'); const findAndroidAppFolder = require('../../android/findAndroidAppFolder');
const mockFS = require('mock-fs');
const mocks = require('../../__fixtures__/android'); const mocks = require('../../__fixtures__/android');
describe('android::findAndroidAppFolder', () => { describe('android::findAndroidAppFolder', () => {

View File

@ -13,9 +13,10 @@
jest.autoMockOff(); jest.autoMockOff();
const mockFS = require('mock-fs'); require('../../__fixtures__/mockFSWorkaround');
const findManifest = require('../../android/findManifest'); const findManifest = require('../../android/findManifest');
const mockFS = require('mock-fs');
const mocks = require('../../__fixtures__/android'); const mocks = require('../../__fixtures__/android');
describe('android::findManifest', () => { describe('android::findManifest', () => {

View File

@ -13,9 +13,10 @@
jest.autoMockOff(); jest.autoMockOff();
const mockFS = require('mock-fs'); require('../../__fixtures__/mockFSWorkaround');
const findPackageClassName = require('../../android/findPackageClassName'); const findPackageClassName = require('../../android/findPackageClassName');
const mockFS = require('mock-fs');
const mocks = require('../../__fixtures__/android'); const mocks = require('../../__fixtures__/android');
describe('android::findPackageClassName', () => { describe('android::findPackageClassName', () => {

View File

@ -13,9 +13,10 @@
jest.autoMockOff(); jest.autoMockOff();
const mockFS = require('mock-fs'); require('../../__fixtures__/mockFSWorkaround');
const getDependencyConfig = require('../../android').dependencyConfig; const getDependencyConfig = require('../../android').dependencyConfig;
const mockFS = require('mock-fs');
const mocks = require('../../__fixtures__/android'); const mocks = require('../../__fixtures__/android');
const userConfig = {}; const userConfig = {};

View File

@ -13,9 +13,10 @@
jest.autoMockOff(); jest.autoMockOff();
const mockFS = require('mock-fs'); require('../../__fixtures__/mockFSWorkaround');
const getProjectConfig = require('../../android').projectConfig; const getProjectConfig = require('../../android').projectConfig;
const mockFS = require('mock-fs');
const mocks = require('../../__fixtures__/android'); const mocks = require('../../__fixtures__/android');
describe('android::getProjectConfig', () => { describe('android::getProjectConfig', () => {

View File

@ -13,10 +13,11 @@
jest.autoMockOff(); jest.autoMockOff();
const mockFS = require('mock-fs'); require('../../__fixtures__/mockFSWorkaround');
const findManifest = require('../../android/findManifest'); const findManifest = require('../../android/findManifest');
const readManifest = require('../../android/readManifest'); const readManifest = require('../../android/readManifest');
const mockFS = require('mock-fs');
const mocks = require('../../__fixtures__/android'); const mocks = require('../../__fixtures__/android');
describe('android::readManifest', () => { describe('android::readManifest', () => {

View File

@ -13,10 +13,9 @@
jest.autoMockOff(); jest.autoMockOff();
const mockFs = require('mock-fs');
const findAssets = require('../findAssets'); const findAssets = require('../findAssets');
const dependencies = require('../__fixtures__/dependencies'); const dependencies = require('../__fixtures__/dependencies');
const mockFs = require('mock-fs');
describe('findAssets', () => { describe('findAssets', () => {
beforeEach(() => { beforeEach(() => {

View File

@ -13,9 +13,10 @@
jest.autoMockOff(); jest.autoMockOff();
const mockFS = require('mock-fs'); require('../../__fixtures__/mockFSWorkaround');
const findProject = require('../../ios/findProject'); const findProject = require('../../ios/findProject');
const mockFS = require('mock-fs');
const projects = require('../../__fixtures__/projects'); const projects = require('../../__fixtures__/projects');
const ios = require('../../__fixtures__/ios'); const ios = require('../../__fixtures__/ios');

View File

@ -13,9 +13,10 @@
jest.autoMockOff(); jest.autoMockOff();
const mockFS = require('mock-fs'); require('../../__fixtures__/mockFSWorkaround');
const getProjectConfig = require('../../ios').projectConfig; const getProjectConfig = require('../../ios').projectConfig;
const mockFS = require('mock-fs');
const projects = require('../../__fixtures__/projects'); const projects = require('../../__fixtures__/projects');
describe('ios::getProjectConfig', () => { describe('ios::getProjectConfig', () => {

View File

@ -232,7 +232,7 @@
"jest": "19.0.2", "jest": "19.0.2",
"jest-repl": "19.0.2", "jest-repl": "19.0.2",
"jest-runtime": "^19.0.3", "jest-runtime": "^19.0.3",
"mock-fs": "^3.11.0", "mock-fs": "^4.3.0",
"react": "16.0.0-alpha.12", "react": "16.0.0-alpha.12",
"react-test-renderer": "16.0.0-alpha.12", "react-test-renderer": "16.0.0-alpha.12",
"shelljs": "0.6.0", "shelljs": "0.6.0",