// Initialize the project with in-memory file system
const project = new Project({
useInMemoryFileSystem: true,
});
// Create source files directly in the in-memory file system
project.createSourceFile('/src/test.ts', 'const a = 12;');
// List all source files in the project
const sourceFiles = project.getSourceFiles();
for (const sourceFile of sourceFiles) {
console.log(sourceFile.getFilePath());
}
// Add source files using a glob pattern
const addedFiles = project.addSourceFilesAtPaths('**/*.*');
console.log(
'files',
addedFiles.map((file) => file.getFilePath()),
);
/*
Outputs:
/src/test.ts
files []
*/
/src/test.ts has been added to the project but addSourceFilesAtPaths('**/*.*') cannot find it.
Expected behavior
addSourceFilesAtPaths('**/*.*') should find created file.
Describe the bug
Version: 22.0.0
To Reproduce
/src/test.ts has been added to the project but
addSourceFilesAtPaths('**/*.*')
cannot find it.Expected behavior
addSourceFilesAtPaths('**/*.*')
should find created file.