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

Tests fail when $HOME is the same as the app directory when using yarn #2043

Closed
jmorrell opened this issue Apr 28, 2017 · 2 comments
Closed

Comments

@jmorrell
Copy link
Contributor

Can you reproduce the problem with latest npm?

No, it is specific to the way yarn sets up its cache directory.

Description

In an environment where $HOME is also the application directory, yarn ends up creating its cache directory within the application directory. This is the case in Heroku's CI environment:

~ $ yarn cache dir
/app/.cache/yarn/v1
~ $ echo $HOME
/app
~ $ pwd
/app

Expected behavior

The default jest config should probably ignore tests found within .cache

Actual behavior

Any *.test.js files in the yarn cache end up getting executed with running yarn test, causing the tests to fail.

Environment

Run these commands in the project folder and fill in their results:

  1. npm ls react-scripts (if you haven’t ejected):
~ $ yarn list react-scripts
yarn list v0.22.0
└─ react-scripts@0.9.5
  1. node -v:
~ $ node -v
v6.10.2
  1. npm -v:
~ $ yarn --version
0.22.0

Then, specify:

  1. Operating system:
~ $ uname -a
Linux fdedd5aa-0bd6-4529-b6bb-e6aef7830852 3.13.0-112-generic #159-Ubuntu SMP Fri Mar 3 15:26:07 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
  1. Browser and version:

N/A

@jmorrell jmorrell changed the title Tests fail when $HOME is the same as the app using yarn Tests fail when $HOME is the same as the app directory when using yarn Apr 28, 2017
@gaearon
Copy link
Contributor

gaearon commented May 1, 2017

The default jest config should probably ignore tests found within .cache

Totally reasonable. PR?

@jmorrell
Copy link
Contributor Author

jmorrell commented May 1, 2017

I totally intended to make a PR but got distracted by something shiny 😅 Created!

@lock lock bot locked and limited conversation to collaborators Jan 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants