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

Indivudual tests very fast but total time is always above 20sec #7619

Closed
nicewaytodoit opened this issue Jan 13, 2019 · 2 comments
Closed

Indivudual tests very fast but total time is always above 20sec #7619

nicewaytodoit opened this issue Jan 13, 2019 · 2 comments
Labels

Comments

@nicewaytodoit
Copy link

I am trying to test simple javascript class withing React project:

Following packages installed:

    "enzyme": "^3.8.0",
    "enzyme-adapter-react-16": "^1.7.1",
    "jest": "^23.6.0",
    "jest-cli": "^23.6.0",
    "react-test-renderer": "^16.7.0",
    "redux-devtools-extension": "^2.13.7",
    "source-map-loader": "^0.2.4",
  System:
    OS: Windows 10
    CPU: (4) x64 Intel(R) Core(TM) m3-7Y30 CPU @ 1.00GHz
  Binaries:
    Node: 10.15.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.13.0 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 6.4.1 - C:\Program Files\nodejs\npm.CMD

I am using default configuration without ejected scripts.

I am testing single file, without any React dependencies or taking snapshot or similar things that could potentially take long time to execute. But, repeatedly these are my test times:

 PASS  src/__tests__/shared/validation.test.js (13.991s)me: 'red' } ] }
  # Validation module :
    √ should have class of red (4ms)
    √ function Argument number should be 1 (1ms)
    # Checking fakeValidationFunction :
      ○ skipped 7 tests
    # Emails should be equal :
      √ should return True if 2 emails equal (78ms)
      √ should return False if 2 emails not equal (43ms)

Test Suites: 1 passed, 1 total
Tests:       7 skipped, 4 passed, 11 total
Snapshots:   0 total
Time:        20.043s

All tests are showing time less than 200ms in total.
But total times are showing 13.99s and 20s, so my question are is this due to VS Code bash terminal, or git-bash, or something else?

What are those 19.8 seconds ? And is there any way to speed this up?

@thymikee
Copy link
Collaborator

Jest spends quite a lot of time crawling and analysing your dependencies before it starts the test so they can be run fast later.

Here are related topics: #7110 #6694 #6783

Closing, because we're aware that there are some speed regressions and this issue doesn't provide any new information that would be useful.

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants