fuhrmanator / FamixTypeScriptImporter

MIT License
2 stars 1 forks source link

Tests that don't define a project using `useInMemoryFileSystem: true` will load node_modules, etc. #60

Closed fuhrmanator closed 1 month ago

fuhrmanator commented 1 month ago

The testing mechanism used creates sample test files with project.createSourceFile().

If the test project is not created without useInMemoryFileSystem: true option, then the test project will load all libraries, such as 'node_modules'. This surely slows down the test, but also can create problems when generating references.

For example, a sample variable named add for an arrow function gets a possible reference from domain.d.ts in the projects node_modules, because it defines an add with the same signature (?).

fuhrmanator commented 1 month ago

Tests modified, fixed in #63