In https://github.com/speedskater/babel-plugin-rewire#test-code-2 a named import is used for the rewire api. Later in the documentation you say If no default export is present, the API-Object named __RewireAPI__ becomes the default export of the module. The example code has no default export so I think the example test should use the default import in order to avoid the as syntax and clarify. The statement If no default export is present, the API-Object named __RewireAPI__ becomes the default export of the module. could be improved by adding and is also available as a named import. If the module without a default export has a named export with the rewire, why also provide it as a default export? Naming clashes are unlikely and no module using this should have an export RewireAPI because that would be confusing.
In https://github.com/speedskater/babel-plugin-rewire#test-code-2 a named import is used for the rewire api. Later in the documentation you say
If no default export is present, the API-Object named __RewireAPI__ becomes the default export of the module.
The example code has no default export so I think the example test should use the default import in order to avoid theas
syntax and clarify. The statementIf no default export is present, the API-Object named __RewireAPI__ becomes the default export of the module.
could be improved by addingand is also available as a named import
. If the module without a default export has a named export with the rewire, why also provide it as a default export? Naming clashes are unlikely and no module using this should have an export RewireAPI because that would be confusing.