Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • C create-react-app
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,547
    • Issues 1,547
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 417
    • Merge requests 417
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • create-react-app
  • Issues
  • #7660
Closed
Open
Issue created Sep 08, 2019 by Administrator@rootContributor

react-scripts test not working with hidden directories (prefixed with `.`)

Created by: nicojs

Describe the bug

When one of the directories in your location is prefixed with a . the react-scripts test isn't working. You can see it when running npm test and then choose to run all. The glob expression used seems to be invalid:

No tests found, exiting with code 1
Run with `--passWithNoTests` to exit with code 0
In C:\z\.my-app
  4 files checked.
  testMatch: C:/z\.my-app/src/**/__tests__/**/*.{js,jsx,ts,tsx}, C:/z\.my-app/src/**/*.{spec,test}.{js,jsx,ts,tsx} - 0 matches
  testPathIgnorePatterns: \\node_modules\\ - 4 matches
  testRegex:  - 0 matches
Pattern:  - 0 matches

Did you try recovering your dependencies?

Simple repro steps for a new project below.

Which terms did you search for in User Guide?

n/a

Environment

  System:
    OS: Windows 10
    CPU: (8) x64 Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz
  Binaries:
    Node: 12.9.1 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.12.3 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 6.9.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: 42.17134.1.0
    Internet Explorer: 11.0.17134.1
  npmPackages:
    react: ^16.9.0 => 16.9.0
    react-dom: ^16.9.0 => 16.9.0
    react-scripts: 3.1.1 => 3.1.1
  npmGlobalPackages:
    create-react-app: Not Found

Steps to reproduce

  1. npx create-react-app my-app
  2. mv my-app .my-app
  3. cd .my-app
  4. npm test

Expected behavior

I would expect the 1 test to run.

Actual behavior

However, no tests are found.

Reproducible demo

Please copy and paste:

npx create-react-app my-app
mv my-app .my-app
cd .my-app
npm test

Select a to run all tests.

Assignee
Assign to
Time tracking