Default tab-navigation app tests broken?

#1

Just getting started with expo.
am on:

  • win 10 Home x64
  • node v8.3.1
  • npm v5.3.0

I did:

  • started XDE
  • create new project
  • selected tab-navigation
  • waited till finish
  • attempted to run tests

did npm test
got

‘node_modules’ is not recognized as an internal or external command,
operable program or batch file.

modified package.json so that

"test": "node_modules/jest/bin/jest.js",

becomes

"test": "jest/bin/jest.js",

run npm test again
got

PS C:\Expo Projects\test-nav> npm test

> test-nav@0.0.0 test C:\Expo Projects\test-nav
> jest/bin/jest.js

No tests found
In C:\Expo Projects\test-nav

changed pacakge.json again
"test": "node ./node_modules/jest/bin/jest.js",
now get a failure. relevant failure is:

FAIL __tests__\App-test.js
● Test suite failed to run

Cannot find module ‘./PlatformHelpers’ from ‘createNavigationContainer.js’

 at Resolver.resolveModule (node_modules/jest/node_modules/jest-resolve/build/index.js:179:17)
 at Object.<anonymous> (node_modules/react-navigation/src/createNavigationContainer.js:39:214)

Is this:

  • Just a pathing issue because stupid windows?
  • Have i forgotten a node/npm/expo config somewhere?

thanks

0 Likes

#2

Sorry the setup experience hasn’t gone better for you!
I’m getting the Cannot find module './PlatformHelpers' error on OSX as well, so I think we have a bad test in there…

0 Likes

#3

Ok, you’ll need to upgrade expo-jest to 19.0.5 to resolve the error. (We put out a new project template that should fix this going forward.)

You may hit some test failures due to mismatched snapshots, in which case you can rm -r __tests__/__snapshots__/ and generate new ones on your next run.

2 Likes

#4

sorry for this! there was a confluence of 1) a change in react-navigation and 2) a bug upstream in react-native that led to this problem. I bumped the react-navigation version just before releasing the template and should have run the tests on the latest version before doing it.

1 Like

#5

@notbrent and @thetc Thank you both.
no worries, I’m mostly trying to see if expo development will work as advertised on windows.

0 Likes