-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[enzyme-adapter-react-14] [fix]
mount
: make sure it works with nati…
…ve arrow functions Fixes #1667.
- Loading branch information
Showing
5 changed files
with
23 additions
and
1 deletion.
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
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
6 changes: 6 additions & 0 deletions
6
packages/enzyme-test-suite/test/_helpers/realArrowFunction.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,6 @@ | ||
try { | ||
// eslint-disable-next-line global-require | ||
module.exports = require('./untranspiledArrowFunction'); | ||
} catch (e) { | ||
module.exports = x => () => x; | ||
} |
3 changes: 3 additions & 0 deletions
3
packages/enzyme-test-suite/test/_helpers/untranspiledArrowFunction.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,3 @@ | ||
// this file is ignored in babelrc, specifically so that tests will be able to run | ||
// on a real arrow function that lacks a .prototype | ||
module.exports = x => () => x; |