Skip to content

Commit

Permalink
remove now-unneeded function
Browse files Browse the repository at this point in the history
  • Loading branch information
alicewriteswrongs committed May 17, 2023
1 parent 659fe6b commit fc7b31c
Showing 1 changed file with 0 additions and 35 deletions.
35 changes: 0 additions & 35 deletions src/compiler/sys/typescript/typescript-sys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ export const patchTypescript = (config: d.Config, inMemoryFs: InMemoryFileSystem
patchTsSystemWatch(config.sys, ts.sys);
}
patchTypeScriptResolveModule(config, inMemoryFs);
patchTypeScriptGetParsedCommandLineOfConfigFile();
(ts as any).__patched = true;
}
};
Expand Down Expand Up @@ -243,37 +242,3 @@ export const getTypescriptPathFromUrl = (config: d.Config, tsExecutingUrl: strin
}
return url;
};

export const patchTypeScriptGetParsedCommandLineOfConfigFile = () => {
const orgGetParsedCommandLineOfConfigFile = ts.getParsedCommandLineOfConfigFile;

const patchedFunc = (
configFileName: string,
optionsToExtend: ts.CompilerOptions,
host: ts.ParseConfigFileHost,
extendedConfigCache: Map<string, ts.ExtendedConfigCacheEntry>
) => {
const results = orgGetParsedCommandLineOfConfigFile(configFileName, optionsToExtend, host, extendedConfigCache);

// manually filter out any .spec or .e2e files
results.fileNames = results.fileNames.filter((f) => {
// filter e2e tests
if (f.includes('.e2e.') || f.includes('/e2e.')) {
return false;
}
// filter spec tests
if (f.includes('.spec.') || f.includes('/spec.')) {
return false;
}
return true;
});

return results;
};

Object.defineProperty(ts, 'getParsedCommandLineOfConfigFile', {
get: () => patchedFunc,
enumerable: true,
configurable: true,
});
};

0 comments on commit fc7b31c

Please sign in to comment.