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

Jest Snapshot Test, Reserved words #264

Closed
jakelacey2012 opened this issue Oct 27, 2016 · 2 comments
Closed

Jest Snapshot Test, Reserved words #264

jakelacey2012 opened this issue Oct 27, 2016 · 2 comments

Comments

@jakelacey2012
Copy link

jakelacey2012 commented Oct 27, 2016

Important note hopefully creating this issue should get the ball rolling, however if you feel the information isn't adequate I understand I just need to get something out here. I will be updating this with more details information and a case scenario when I get time.

Version

Tell us which versions you are using:

  • tcomb-form-native v^0.6.1
  • react-native v^0.34.0

Expected behaviour

I expect to be able to import this module without getting reserved word errors.

Actual behaviour

SyntaxError: Unexpected reserved word when using import FormValidation from 'tcomb-form-native'

Steps to reproduce

  1. Created a snapshot test which imports import FormValidation from 'tcomb-form-native'

Stack trace and console log

(ノಥ,_」ಥ)ノ彡┻━┻ Jakes-MacBook-Pro[react-native-starter-app] (feature/reactJestTesting)$npm test -- -u

> StarterKit@1.0.0 test /Users/jakelacey/Documents/workspace/reactnative/react-native-starter-app
> jest "-u"

 PASS  ReactApp/components/__tests__/navbar.elements-tests.js
 PASS  ReactApp/components/__tests__/error-tests.js
 PASS  ReactApp/components/__tests__/alerts-tests.js
 PASS  ReactApp/components/__tests__/button-tests.js
 PASS  ReactApp/components/__tests__/loading-tests.js
 PASS  ReactApp/components/__tests__/list.row-tests.js
 FAIL  ReactApp/components/__tests__/menu-tests.js
  ● Test suite failed to run

    SyntaxError: Unexpected reserved word

      at transformAndBuildScript (node_modules/jest-runtime/build/transform.js:284:10)
      at Object.<anonymous> (ReactApp/screens/forms.js:22:22)
      at Object.<anonymous> (ReactApp/screens/first.load.js:27:12)
[core]

Test Suites: 1 failed, 6 passed, 7 total
Tests:       7 passed, 7 total
Snapshots:   7 passed, 7 total
Time:        4.166s
Ran all test suites.
npm ERR! Test failed.  See above for more details.

There is some documentation in Jest which may highlight why this is an issue when I find it I will add it so the thread.

Thank you.

@dvisco
Copy link

dvisco commented Nov 7, 2016

We were having issues as well till we upgraded to 0.6.1 and mirrored the jest configuration in the snowflake app

@jakelacey2012
Copy link
Author

Thanks for the info that helped solve it.

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

2 participants