MCPcopy Index your code
hub / github.com/angular/components / runTypeScriptCompatibilityTest

Function runTypeScriptCompatibilityTest

integration/ts-compat/helpers.mjs:16–39  ·  view source on GitHub ↗
(tscBinPath)

Source from the content-addressed store, hash-verified

14 * compiles a test file using the specified tsc binary which imports all entry-points.
15 */
16export async function runTypeScriptCompatibilityTest(tscBinPath) {
17 return new Promise((resolve, reject) => {
18 const tscArgs = [
19 '--strict',
20 // Disables automatic type resolution. In non-sandbox environments, the node modules
21 // are accessible and types could end up as part of the program.
22 '--types',
23 '--lib',
24 'es2015,dom',
25 testFilePath,
26 '--moduleResolution',
27 'bundler',
28 '--module',
29 'es2022',
30 ];
31 // Run `tsc` to compile the project. The stdout/stderr output is inherited, so that
32 // warnings and errors are printed to the console.
33 const tscProcess = fork(tscBinPath, tscArgs, {stdio: 'inherit'});
34
35 tscProcess.on('exit', exitCode => {
36 exitCode === 0 ? resolve() : reject();
37 });
38 });
39}

Callers 1

test.mjsFile · 0.90

Calls 1

onMethod · 0.45

Tested by

no test coverage detected