Closed mealplana closed 3 years ago
Can you please try this solution?
Hi @ArtemGovorov - thanks! I think this helped, I managed to run all the tests in 9 min now.
I also noticed - I think I have a couple of tests that are really inefficient and I can improve. E.g. i have a test that renders the whole app without mocking subcomponents, so this probably is causing the high memory usage.
I also noticed that many of my files that are reported as taking too long are files such as src/lib/crud/index.ts I have several "index.ts" files that are just reexporting modules within their folder. For example:
export { CrudDocsManager } from './CrudDocsManager';
export { CrudDocsSearch } from './search/CrudDocsSearch';
export { getCellToDateFormatter, getOnCreateOptions } from './CrudDocsUtil';
export * from './CrudDocAPI';
export { ViewDoc } from './view/single/ViewDoc';
export { ViewChildDocs } from './view/single/ViewChildDocs';
export { ViewMultipleChildDocs } from './view/multiple/ViewMultipleChildDocs';
export { CrudSpreadsheetEditor } from './view/spreadsheet/full/CrudSpreadsheetEditor';
export { FixedSpreadsheetEditor } from './view/spreadsheet/fixed/FixedSpreadsheetEditor';
export { CreateDoc } from './create/CreateDoc';
export { ApolloQueryResultWrapper } from './list/result/ApolloQueryResultWrapper';
export { CrudEditor } from './editor/CrudEditor';
I will try to rewrite the tests that cause the runner to have to render the whole app as that is obviously inefficient - but any idea why the index.ts files that just reexport components would be problematic?
I will try to rewrite the tests that cause the runner to have to render the whole app as that is obviously inefficient - but any idea why the index.ts files that just reexport components would be problematic?
My guess is that the first consumer of such file causes all dependant files to be compiled/processed by Jest and it takes some time (running Jest from terminal is not much different, the issue is just not reported by vanilla Jest). Also it may not an issue per se, Wallaby just lets you know that some tests are running more than 5 seconds to load.
Issue description or question
When I run Wallaby in my Typescript/React project the software runs out of memory. When I run my ~700 tests using jest on the terminal it works (takes around 10 minutes on my Mac) but I haven't manage to run all tests with coverage with Wallaby.
I have 8GB of RAM in this laptop, and I am using Webstorm.
I am using automatic configuration.
When I use the Exclusive test run feature to only run Wallaby for a particular folder it works great. I installed this tool today and I already love it, I would be happy to buy a license if I can get it to work for the project. I am attaching the diagnostics report below.
Am I doing something extremely inefficient in the tests/projects that I am missing? Any help would be appreciated.
Wallaby diagnostics report