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

Simple jest test fails with @exponent error #36

Closed
bdickason opened this issue May 25, 2017 · 7 comments
Closed

Simple jest test fails with @exponent error #36

bdickason opened this issue May 25, 2017 · 7 comments

Comments

@bdickason
Copy link
Member

I was going to take a stab at writing a few tests as I thought it might help me get to know the project (And get us some automated coverage so we don't have to manually test everything :P). Unfortunately, there is some weird behavior with the @exponent module and jest.

I've run through a few solutions so far:

  1. Ignore the module from jest tests - this doesn't seem to work (still throws errors in other modules)
  2. Install a patch to jest to monkey patch @exponent - this gives me errors in other modules (reactjs)
  3. Manually monkey patch jest's linker - this still gives the same error
  4. Try upgrading to the latest version of @expo (v3.0.0) - I still get the same error
  5. Try upgrading to the latest version of react-native (because @expo v3.0.0 throws errors about react version mismatch) - I still get errors after doing this.

Error Log:

 FAIL  __tests__/index.ios.js
  ● Test suite failed to run

    /Users/bdickason/code/t7-chicken-native/node_modules/@expo/ex-navigation/src/ExNavigation.js:5
    export { default as NavigationProvider } from './ExNavigationProvider';
    ^^^^^^
    SyntaxError: Unexpected token export

      at transformAndBuildScript (node_modules/jest-runtime/build/transform.js:316:10)
      at Object.<anonymous> (index.ios.js:10:19)
      at Object.<anonymous> (__tests__/index.ios.js:3:15)

 FAIL  __tests__/index.android.js
  ● Test suite failed to run

    /Users/bdickason/code/t7-chicken-native/node_modules/@expo/ex-navigation/src/ExNavigation.js:5
    export { default as NavigationProvider } from './ExNavigationProvider';
    ^^^^^^
    SyntaxError: Unexpected token export

      at transformAndBuildScript (node_modules/jest-runtime/build/transform.js:316:10)
      at Object.<anonymous> (index.android.js:10:19)
      at Object.<anonymous> (__tests__/index.android.js:3:19)

Test Suites: 2 failed, 2 total
Tests:       0 total
Snapshots:   0 total
Time:        5.017s
Ran all test suites.
@bdickason bdickason changed the title npm test fails with @exponent error Simple jest test fails with @exponent error May 25, 2017
@dxn7335
Copy link
Collaborator

dxn7335 commented May 25, 2017

Hey @bdickason, there was a big change to transition our navigation routing from @exponent to using react-navigation. Possibly you can try testing again, and seeing if the same errors occur with the new setup?

The changes should be on develop. Also, nice to meet you!

@bdickason
Copy link
Member Author

Will do!! I didn't even think to look at your branching strategy 👍

I'll check out develop and see how it looks.

Is there a writeup on how you handle branches and development anywhere that I can check out? (i.e. develop is always stable, master is always stable, etc)

@bdickason
Copy link
Member Author

@dxn7335 I'm still getting this error on the develop branch as it looks like store.js still depends on @exponent.

See https://github.com/ndejesus1227/t7-chicken-native/blob/develop/src/redux/store.js#L1

@dxn7335
Copy link
Collaborator

dxn7335 commented May 25, 2017

@bdickason Oh! I just pushed a change to remove that reference. Looks like not everything might've gotten removed. I'll start picking out any leftover references out in the morning.

@bdickason
Copy link
Member Author

This works as of @dxn7335's commits :) Still have some errors that are tough to debug, but I'm one step closer :D

@dayhaysoos
Copy link
Member

@bdickason thanks man! Sorry I haven't gotten back to you yet about how things are running, but I think I'm gonna let you do your thing for now, if you have any questions at all please message me on Facebook.

@bdickason
Copy link
Member Author

@ndejesus1227 no prob! I'm just poking around on things that are not critical path to learn the codebase and ramp up.

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

No branches or pull requests

3 participants