Closed
Description
Suggestion
Within packages/typescript-estree
, parse.test.ts
takes about ~11 seconds on average on my M2 Macbook Air. That's quite a lot of time to spend on one test file.
I set the slowTestThreshold
to 0
and ran it locally. Here are the tests that took >100ms:
parseAndGenerateServices
preserveNodeMaps
✓ should preserve node maps by default for parseAndGenerateServices() (666 ms)
project includes
✓ doesn't error for matched files (484 ms)
invalid project error messages
✓ throws when non of multiple projects include the file (507 ms)
projectFolderIgnoreList
✓ ignores nothing when given nothing (897 ms)
✓ ignores a folder when given a string glob (431 ms)
moduleResolver
when file is in the project
✓ returns error if __PLACEHOLDER__ can not be resolved (1998 ms)
✓ resolves __PLACEHOLDER__ correctly (1903 ms)
when file is not in the project and createDefaultProgram=true
✓ returns error because __PLACEHOLDER__ can not be resolved (1607 ms)
✓ resolves __PLACEHOLDER__ correctly (1740 ms)
Proposal: let's move each of the groups inside parseAndGenerateServices
to their own test file? For example, parse.moduleResolver.test.ts
? That way test runners able to parallelize test running across different cores will be able to make these tests run more in parallel. I applied a similar change in #4599.