Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<rootDir>/number.js export to module.exports #1768

Closed

Conversation

kyoncy
Copy link

@kyoncy kyoncy commented Mar 11, 2020

Related issues

Fix #1766

When execute Jest in my project, this error was displayed.

  ● Test suite failed to run

    /path/to/project/node_modules/mathjs/number.js:1
    ({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,global,jest){export * from './main/esm/number' // eslint-disable-line
                                                                                             ^^^^^^

    SyntaxError: Unexpected token 'export'

Why changes

In mathjs/index.js using module.exports.

module.exports = require('./lib/entry/mainAny')

But mathjs/number.js using export * from ''.

export * from './main/esm/number' // eslint-disable-line

So, I change the mathjs/number.js, Jest test was passed!

- export * from './main/esm/number' // eslint-disable-line
+ module.exports = require('./lib/entry/mainNumber') 

@kyoncy kyoncy changed the title 🔧 number.js export to module.exports <rootDir>/number.js export to module.exports Mar 11, 2020
@alanhe421
Copy link

When will PR merge? This affects the operation of UT

@josdejong
Copy link
Owner

When will PR merge? This affects the operation of UT

There are still some things that need to be sorted out before merging a fix, see #1766 (comment) (workaround also discussed there).

Help would be welcome.

@kyoncy kyoncy closed this Jan 12, 2022
@kyoncy kyoncy deleted the fix/number_export_to_module.exports branch January 12, 2022 06:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SyntaxError: Unexpected token 'export' in Jest environment using mathjs/number
3 participants