Last active
October 20, 2024 17:12
-
-
Save hawkrives/17a2d54ddb3614197931 to your computer and use it in GitHub Desktop.
6to5 _interopRequire and node `exports`
This file contains hidden or 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
| let coursesAtOrAboveLevel = (level, course) => (course.level >= level) | |
| export {coursesAtOrAboveLevel} |
This file contains hidden or 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
| // test/courseLevels.test.js | |
| import courseLevels from './src' | |
| let coursesAtOrAboveLevel = courseLevels.coursesAtOrAboveLevel | |
| assert(coursesAtOrAboveLevel(200, {level: 200}) === true) |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When run (
6to5-node test.js), you would expect to be able to read thecoursesAtOrAboveLevelproperty off the imported object.You can't; node dies with