Skip to content

Commit

Permalink
docs(JestObjectAPI jest-mock): Add explanation for __esModule: true
Browse files Browse the repository at this point in the history
  • Loading branch information
sargalias committed Jun 11, 2019
1 parent 29b3928 commit cc774e5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/JestObjectAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ const moduleName = require('../moduleName');
moduleName(); // Will return '42';
```

When using the `factory` parameter for an ES6 module with a default export, the `__esModule: true` property needs to be specified:
When using the `factory` parameter for an ES6 module with a default export, the `__esModule: true` property needs to be specified. This property is normally generated by Babel / TypeScript, but here it needs to be set manually. When importing a default export, it's an instruction to import the property named `default` from the export object:

```js
import moduleName, {foo} from '../moduleName';
Expand Down

0 comments on commit cc774e5

Please sign in to comment.