teambit / envs

Component development environments for the Bit community
https://bit.dev/bit/envs
Other
63 stars 9 forks source link

Bit cannot find test file when running tests #123

Open makeupsomething opened 4 years ago

makeupsomething commented 4 years ago

Description

I had a bit component already exported, and later added a test to it. I seem to be able to add the tester and test file but when I run the tests I get a warning

bit found test file tracked in synspective.icons/status-icon@0.2.5, but none was found when running tests
if you encounter this issue, please open a GitHub issue with the build and test environments.

You can see the component details here

╔═══════════════════╤════════════════════════════════════════════════════╗
║ Id                │ status-icon@0.2.5                                  ║
╟───────────────────┼────────────────────────────────────────────────────╢
║ Compiler          │ bit.envs/compilers/react-typescript@3.1.44         ║
╟───────────────────┼────────────────────────────────────────────────────╢
║ Tester            │ bit.envs/testers/jest@22.4.3                       ║
╟───────────────────┼────────────────────────────────────────────────────╢
║ Language          │ javascript                                         ║
╟───────────────────┼────────────────────────────────────────────────────╢
║ Main File         │ src/components/Icons/StatusIcon/index.tsx          ║
╟───────────────────┼────────────────────────────────────────────────────╢
║ Dependencies      │ synspective.themes/default-theme@0.1.6             ║
║                   │ styled-components@^5.0.1                           ║
║                   │ @types/react@^16.9.0                               ║
╟───────────────────┼────────────────────────────────────────────────────╢
║ Dev Dependencies  │ @testing-library/jest-dom@^5.5.0                   ║
║                   │ @testing-library/react@^10.0.2                     ║
╟───────────────────┼────────────────────────────────────────────────────╢
║ Peer Dependencies │ react@^16.11.0                                     ║
║                   │ react-dom@^16.11.0                                 ║
║                   │ @types/react@16.9.11                               ║
║                   │ @types/react-dom@16.9.4                            ║
╟───────────────────┼────────────────────────────────────────────────────╢
║ Files             │ src/components/Icons/StatusIcon/index.tsx          ║
╟───────────────────┼────────────────────────────────────────────────────╢
║ Specs             │ src/components/Icons/StatusIcon/__tests__/StatusIc ║
║                   │ on.spec.js                                         ║
╚═══════════════════╧════════════════════════════════════════════════════╝

Specifications

Context and additional information

GiladShoham commented 4 years ago

@makeupsomething Thanks for reporting this. That's a bug in the compiler itself. We saw a similar bug in the typescript compiler. You can read more here - https://github.com/teambit/envs/issues/10 I guess it's the same issue. I'll move this to the envs repo to be handled there.

qballer commented 4 years ago

Hi @makeupsomething can you provide a link to an example component? I would like to debug this issue. @GiladShoham is right that it sounds like an issue with the compiler letting bit know which compiled filed are the test files.

Mouvedia commented 4 years ago

Iv got the same problem using the stencil compiler.

GiladShoham commented 4 years ago

@Mouvedia Please open a new issue for the stencil compiler

joeskeen commented 3 years ago

I also see this problem in an Angular component:

╔═══════════════════╤════════════════════════════════════════════════════╗
║ Id                │ change-case-pipe@0.0.2                             ║
╟───────────────────┼────────────────────────────────────────────────────╢
║ Compiler          │ bit.envs/compilers/angular@9.0.21                  ║
╟───────────────────┼────────────────────────────────────────────────────╢
║ Tester            │ bit.envs/testers/jest@22.4.3                       ║
╟───────────────────┼────────────────────────────────────────────────────╢
║ Language          │ javascript                                         ║
╟───────────────────┼────────────────────────────────────────────────────╢
║ Main File         │ src/lib/change-case-pipe/change-case-pipe.module.t ║
║                   │ s                                                  ║
╟───────────────────┼────────────────────────────────────────────────────╢
║ Dependencies      │                                                    ║
╟───────────────────┼────────────────────────────────────────────────────╢
║ Dev Dependencies  │ tslib@>=1.0.0                                      ║
║                   │ webpack-env@>=0.8.0                                ║
║                   │ @angular/core@>= 8.0.0                             ║
║                   │ @angular/common@>= 8.0.0                           ║
╟───────────────────┼────────────────────────────────────────────────────╢
║ Peer Dependencies │ @angular/core@^8.0.0                               ║
║                   │ change-case@^4.1.1                                 ║
╟───────────────────┼────────────────────────────────────────────────────╢
║ Files             │ src/lib/change-case-pipe/change-case-pipe.module.t ║
║                   │ s                                                  ║
║                   │ src/lib/change-case-pipe/change-case.pipe.ts       ║
║                   │ src/lib/change-case-pipe/index.ts                  ║
║                   │ src/lib/change-case-pipe/package.json              ║
╟───────────────────┼────────────────────────────────────────────────────╢
║ Specs             │ src/lib/change-case-pipe/change-case.pipe.spec.ts  ║
╚═══════════════════╧════════════════════════════════════════════════════╝