Allowed .env file in source control for test-utils setup

refs https://github.com/TryGhost/members.js/issues/5

- We want to allow .env in source control mainly to use react-testing-library's recommended setup for common test-utils. It uses .env file to define NODE_PATH, which helps in avoiding relative imports in tests as we keep test files next to UI components.
- CRA also by default suggests committing .env files to source control
This commit is contained in:
Rish 2020-04-28 23:15:09 +05:30
parent c3907f24dd
commit d83382ffb5

View File

@ -57,7 +57,7 @@ typings/
.yarn-integrity .yarn-integrity
# dotenv environment variables file # dotenv environment variables file
.env .env.*
# IDE # IDE
.idea/* .idea/*
@ -72,8 +72,9 @@ typings/
umd/ umd/
build/ build/
## config # Allow .env file
.env.local !.env
.env.development.local ## We use .env file to define NODE_PATH as recommended test-utils setup pattern to avoid relative imports.
.env.test.local # Refs: https://testing-library.com/docs/react-testing-library/setup#jest-and-create-react-app
.env.production.local # CRA also suggests `.env` files should be checked into source control
# Ref: https://create-react-app.dev/docs/adding-custom-environment-variables/#adding-development-environment-variables-in-env