Skip to content

Bit cannot find test file when running tests #123

Open

Description

@makeupsomething

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

  • Bit version: 14.7.4
  • Node version: v12.13.1
  • npm / yarn version:1.19.2
  • Platform:macOS
  • Bit compiler (include version):bit.envs/compilers/react-typescript@3.1.44
  • Bit tester (include version):bit.envs/testers/jest@22.4.3

Context and additional information

Activity

  1. GiladShoham commented on Apr 13, 2020

    @GiladShoham
    Member

    @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 - #10
    I guess it's the same issue.
    I'll move this to the envs repo to be handled there.

  2. transferred this issue fromteambit/biton Apr 13, 2020
  3. qballer commented on Apr 18, 2020

    @qballer
    Contributor

    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.

  4. self-assigned this
    on Apr 18, 2020
  5. Mouvedia commented on May 22, 2020

    @Mouvedia

    Iv got the same problem using the stencil compiler.

  6. GiladShoham commented on Jun 2, 2020

    @GiladShoham
    Member

    @Mouvedia Please open a new issue for the stencil compiler

  7. removed their assignment
    on Jun 19, 2020
  8. self-assigned this
    on Jul 20, 2020
  9. joeskeen commented on Jul 29, 2020

    @joeskeen

    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  ║
    ╚═══════════════════╧════════════════════════════════════════════════════╝
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions