Skip to content

Commit

Permalink
Add changelog entry for #4740 (#4742)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB authored and cpojer committed Oct 23, 2017
1 parent 693e653 commit eb9f3f8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* `[jest-runtime]` Move `babel-core` to peer dependencies so it works with Babel 7 ([#4557](https://github.com/facebook/jest/pull/4557))
* `[jest-util]` Fix `runOnlyPendingTimers` for `setTimeout` inside `setImmediate` ([#4608](https://github.com/facebook/jest/pull/4608))
* `[jest-message-util]` Always remove node internals from stacktraces ([#4695](https://github.com/facebook/jest/pull/4695))
* `[jest-resolve]` changes method of determining builtin modules to include missing builtins ([#4740](https://github.com/facebook/jest/pull/4740))

### Features
* `[jest-environment-*]` [**BREAKING**] Add Async Test Environment APIs, dispose is now teardown ([#4506](https://github.com/facebook/jest/pull/4506))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
const isBuiltinModule = require('../is_builtin_module');
// @flow

import isBuiltinModule from '../is_builtin_module';

describe('isBuiltinModule', () => {
it('should return true for the `path` module', () => {
Expand Down
14 changes: 12 additions & 2 deletions packages/jest-resolve/src/is_builtin_module.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
/**
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
*/

// https://github.com/facebook/flow/pull/5160
declare var process: {
binding(type: string): {},
};
Expand All @@ -6,6 +16,6 @@ const BUILTIN_MODULES = Object.keys(process.binding('natives')).filter(
(module: string) => !/^internal\//.test(module),
);

module.exports = function isBuiltinModule(module: string): boolean {
export default function isBuiltinModule(module: string): boolean {
return BUILTIN_MODULES.indexOf(module) !== -1;
};
}

0 comments on commit eb9f3f8

Please sign in to comment.