-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Implement module.parent.require * Implement module.parent.filename * Implement module.parent.id * Try to set parent to actual parent module * Fix tests * styel nit to minimize diff * Fix failing test * Make module.parent a lazy getter * make `parent` enumerable * Share type definition for ModuleRegistry * module.parent should be null not undefined for entrypoints
- Loading branch information
Showing
8 changed files
with
127 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
packages/jest-runtime/src/__tests__/test_root/RequireRegularModule.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/** | ||
* 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. | ||
* | ||
* @providesModule RequireRegularModule | ||
*/ | ||
|
||
'use strict'; | ||
|
||
module.exports.parent = require('RegularModule').parent; |
14 changes: 14 additions & 0 deletions
14
packages/jest-runtime/src/__tests__/test_root/inner_parent_module.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/** | ||
* 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. | ||
* | ||
* @providesModule inner_parent_module | ||
*/ | ||
|
||
'use strict'; | ||
|
||
const impl = require('module-needing-parent'); | ||
|
||
module.exports = impl; |
12 changes: 12 additions & 0 deletions
12
packages/jest-runtime/src/__tests__/test_root/node_modules/module-needing-parent/index.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
10 changes: 10 additions & 0 deletions
10
..._tests__/test_root/node_modules/module-needing-parent/node_modules/parent-module/index.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
11 changes: 11 additions & 0 deletions
11
packages/jest-runtime/src/__tests__/test_root/node_modules/parent-module/index.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters