diff --git a/packages/jest-file-exists/.npmignore b/packages/jest-file-exists/.npmignore deleted file mode 100644 index 85e48fe7b0a4..000000000000 --- a/packages/jest-file-exists/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -**/__mocks__/** -**/__tests__/** -src diff --git a/packages/jest-file-exists/package.json b/packages/jest-file-exists/package.json deleted file mode 100644 index 00bfacdcfa0a..000000000000 --- a/packages/jest-file-exists/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "jest-file-exists", - "version": "19.0.0", - "repository": { - "type": "git", - "url": "https://github.com/facebook/jest.git" - }, - "license": "BSD-3-Clause", - "main": "build/index.js" -} diff --git a/packages/jest-file-exists/src/__tests__/index-test.js b/packages/jest-file-exists/src/__tests__/index-test.js deleted file mode 100644 index e12ae29ac0c0..000000000000 --- a/packages/jest-file-exists/src/__tests__/index-test.js +++ /dev/null @@ -1,36 +0,0 @@ -/** - * Copyright (c) 2014-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. - * - * @emails oncall+jsinfra - */ -'use strict'; - -const fileExists = require('../'); -const path = require('path'); - -test('file exists', () => { - expect(fileExists(__filename)).toBe(true); -}); - -test('file exists if module map is provided', () => { - expect( - fileExists('/random-string.js', { - exists: filePath => filePath === '/random-string.js', - }), - ).toBe(true); -}); - -test('file does not exist', () => { - expect( - fileExists( - path.join(path.basename(__filename), 'does-probably-not-exist.js'), - { - exists: filePath => filePath === '/random-string.js', - }, - ), - ).toBe(false); -}); diff --git a/packages/jest-file-exists/src/index.js b/packages/jest-file-exists/src/index.js deleted file mode 100644 index ac28e94d10d3..000000000000 --- a/packages/jest-file-exists/src/index.js +++ /dev/null @@ -1,19 +0,0 @@ -/** - * Copyright (c) 2014, 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. - * - * @flow - */ - -'use strict'; - -import type {Path} from 'types/Config'; -import type {HasteFS} from 'types/HasteMap'; - -const fs = require('fs'); - -module.exports = (filePath: Path, hasteFS: ?HasteFS): boolean => - (hasteFS && hasteFS.exists(filePath)) || fs.existsSync(filePath);