question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Project from react-native init no longer includes __tests__ directory

See original GitHub issue

Environment

This is not applicable to my issue because the bug I’m reporting is around react-native init, but here’s what info I get from running the command within the generated folder:

➜  bin > react-native --version
react-native-cli: 2.0.1
react-native: n/a - not inside a React Native project directory
➜  bin > cd MyAwesomeProject
➜  MyAwesomeProject > react-native info
Scanning folders for symlinks in /Users/ashfurrow/bin/MyAwesomeProject/node_modules (44ms)

Environment:
  OS: macOS High Sierra 10.13.5
  Node: 8.4.0
  Yarn: 1.6.0
  npm: 5.3.0
  Watchman: 4.9.0
  Xcode: Xcode 9.4.1 Build version 9F2000
  Android Studio: Not Found

Packages: (wanted => installed)
  react: 16.3.1 => 16.3.1
  react-native: 0.55.4 => 0.55.4

I see this isn’t using the latest React Native version, but it is using the latest react-native-cli version.

Description

The project generated by running react-native init no longer includes a __tests__ directory. At some point, it did but I can’t find where in the changelog that it was removed.

The init command appears to pull in the template from this directory of the repo, which includes a __tests__ directory, but I took a look around and I’m not sure what the problem is. I’m happy to help provide more details or dive into debugging this with some guidance. Thanks!

Reproducible Demo

In a terminal, run react-native init TestApp and then cd into the TestApp directory.

Expected results: there is a __tests__ directory with a basic test for App.js.

Actual results: there is no __tests__ directory.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:7
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
hramoscommented, Jun 16, 2018

Thanks for reporting this!

0reactions
hramoscommented, Jan 15, 2019

Thanks for migrating the issue, let me close this one.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I regenerate ios folder in React Native project?
Open Terminal/cmd · Move to the folder/directory where the project "ProjectName" folder exist(Do not go into project directory) · run command as: ...
Read more >
Setup - Testing Library
To make your custom test file accessible in your Jest test files without using relative imports ( ../../test-utils ), add the folder containing ......
Read more >
Troubleshooting - React Native
If you added React Native manually to your project, make sure you have included all the relevant dependencies that you are using, like...
Read more >
Testing React Native Apps - Jest
If you are upgrading your react-native application and previously used the jest-react-native preset, remove the dependency from your package.
Read more >
How To Structure a React Native Project: Best Practices
Click here to know how to better organize your React applications. ... This directory will contain all major project files.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found