Skip to content

Commit efa840e

Browse files
committed
build: add @ts-ignore to surpress bazel ts errors
1 parent 60878b8 commit efa840e

21 files changed

+70
-2
lines changed

tests/legacy-cli/e2e/setup/010-local-publish.ts

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { npm } from '../utils/process';
33
import { isPrereleaseCli } from '../utils/project';
44

55
export default async function () {
6+
// @ts-ignore
67
const testRegistry = getGlobalVariable('package-registry');
78
await npm(
89
'run',

tests/legacy-cli/e2e/setup/300-log-environment.ts

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export default async function () {
1010
return;
1111
}
1212

13+
// @ts-ignore
1314
console.log(` ${envName}: ${process.env[envName].replace(/[\n\r]+/g, '\n ')}`);
1415
});
1516

tests/legacy-cli/e2e/setup/500-create-project.ts

+2
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,15 @@ export default async function () {
1717
process.chdir(argv.reuse);
1818
await gitClean();
1919
} else {
20+
// @ts-ignore
2021
const extraArgs = [];
2122
const testRegistry = getGlobalVariable('package-registry');
2223
const isCI = getGlobalVariable('ci');
2324

2425
// Ensure local test registry is used when outside a project
2526
await setNPMConfigRegistry(true);
2627

28+
// @ts-ignore
2729
await ng('new', 'test-project', '--skip-install', ...extraArgs);
2830
await expectFileToExist(join(process.cwd(), 'test-project'));
2931
process.chdir('./test-project');

tests/legacy-cli/e2e/tests/build/build-app-shell-with-schematic.ts

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export default async function () {
1212

1313
const isSnapshotBuild = getGlobalVariable('argv')['ng-snapshots'];
1414
if (isSnapshotBuild) {
15+
// @ts-ignore
1516
const packagesToInstall = [];
1617
await updateJsonFile('package.json', (packageJson) => {
1718
const dependencies = packageJson['dependencies'];
@@ -23,6 +24,7 @@ export default async function () {
2324
}
2425
});
2526

27+
// @ts-ignore
2628
for (const pkg of packagesToInstall) {
2729
await installPackage(pkg);
2830
}

tests/legacy-cli/e2e/tests/build/platform-server.ts

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export default async function () {
1212

1313
const isSnapshotBuild = getGlobalVariable('argv')['ng-snapshots'];
1414
if (isSnapshotBuild) {
15+
// @ts-ignore
1516
const packagesToInstall = [];
1617
await updateJsonFile('package.json', (packageJson) => {
1718
const dependencies = packageJson['dependencies'];
@@ -23,6 +24,7 @@ export default async function () {
2324
}
2425
});
2526

27+
// @ts-ignore
2628
for (const pkg of packagesToInstall) {
2729
await installPackage(pkg);
2830
}

tests/legacy-cli/e2e/tests/build/prod-build.ts

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ export default async function () {
4141
}
4242

4343
const indexContent = await readFile('dist/test-project/index.html');
44+
// @ts-ignore
4445
const mainPath = indexContent.match(/src="(main\.[0-9a-zA-Z]{0,32}\.js)"/)[1];
4546

4647
// Content checks

tests/legacy-cli/e2e/tests/commands/add/add-pwa.ts

+3
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,12 @@ export default async function () {
5353

5454
// It should correctly generate assetGroups and include at least one URL in each group.
5555
const ngswJson = JSON.parse(await readFile(ngswPath));
56+
// @ts-ignore
5657
const assetGroups = ngswJson.assetGroups.map(({ name, urls }) => ({
5758
name,
5859
urlCount: urls.length,
5960
}));
61+
// @ts-ignore
6062
const emptyAssetGroups = assetGroups.filter(({ urlCount }) => urlCount === 0);
6163

6264
if (assetGroups.length === 0) {
@@ -65,6 +67,7 @@ export default async function () {
6567
if (emptyAssetGroups.length > 0) {
6668
throw new Error(
6769
'Expected all asset-groups to contain at least one URL, but the following groups are empty: ' +
70+
// @ts-ignore
6871
emptyAssetGroups.map(({ name }) => name).join(', '),
6972
);
7073
}

tests/legacy-cli/e2e/tests/i18n/ivy-localize-basehref.ts

+8
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ export default async function () {
4545
// Build each locale and verify the output.
4646
await ng('build');
4747
for (const { lang, outputPath } of langTranslations) {
48+
// @ts-ignore
4849
if (baseHrefs[lang] === undefined) {
4950
throw new Error('Invalid E2E test setup: unexpected locale ' + lang);
5051
}
@@ -53,18 +54,21 @@ export default async function () {
5354
await expectFileToMatch(`${outputPath}/index.html`, `lang="${lang}"`);
5455

5556
// Verify the HTML base HREF attribute is present
57+
// @ts-ignore
5658
await expectFileToMatch(`${outputPath}/index.html`, `href="${baseHrefs[lang] || '/'}"`);
5759

5860
// Execute Application E2E tests with dev server
5961
await ng('e2e', `--configuration=${lang}`, '--port=0');
6062

6163
// Execute Application E2E tests for a production build without dev server
64+
// @ts-ignore
6265
const server = externalServer(outputPath, baseHrefs[lang] || '/');
6366
try {
6467
await ng(
6568
'e2e',
6669
`--configuration=${lang}`,
6770
'--dev-server-target=',
71+
// @ts-ignore
6872
`--base-url=http://localhost:4200${baseHrefs[lang] || '/'}`,
6973
);
7074
} finally {
@@ -83,18 +87,21 @@ export default async function () {
8387
await ng('build', '--configuration=development');
8488
for (const { lang, outputPath } of langTranslations) {
8589
// Verify the HTML base HREF attribute is present
90+
// @ts-ignore
8691
await expectFileToMatch(`${outputPath}/index.html`, `href="/test${baseHrefs[lang] || '/'}"`);
8792

8893
// Execute Application E2E tests with dev server
8994
await ng('e2e', `--configuration=${lang}`, '--port=0');
9095

9196
// Execute Application E2E tests for a production build without dev server
97+
// @ts-ignore
9298
const server = externalServer(outputPath, '/test' + (baseHrefs[lang] || '/'));
9399
try {
94100
await ng(
95101
'e2e',
96102
`--configuration=${lang}`,
97103
'--dev-server-target=',
104+
// @ts-ignore
98105
`--base-url=http://localhost:4200/test${baseHrefs[lang] || '/'}`,
99106
);
100107
} finally {
@@ -108,6 +115,7 @@ export default async function () {
108115
// Verify the HTML base HREF attribute is present
109116
await expectFileToMatch(
110117
`${outputPath}/index.html`,
118+
// @ts-ignore
111119
`href="http://www.domain.com${baseHrefs[lang] || '/'}"`,
112120
);
113121
}

tests/legacy-cli/e2e/tests/i18n/ivy-localize-hashes.ts

+3
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export default async function () {
2727
continue;
2828
}
2929

30+
// @ts-ignore
3031
hashes.set(`${lang}/${match.groups.name}`, match.groups.hash);
3132
}
3233
}
@@ -48,11 +49,13 @@ export default async function () {
4849
continue;
4950
}
5051

52+
// @ts-ignore
5153
const id = `${lang}/${match.groups.name}`;
5254
const hash = hashes.get(id);
5355
if (!hash) {
5456
throw new Error('Unexpected output entry: ' + id);
5557
}
58+
// @ts-ignore
5659
if (hash === match.groups.hash) {
5760
throw new Error('Hash value did not change for entry: ' + id);
5861
}

tests/legacy-cli/e2e/tests/i18n/setup.ts

+1
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ export async function setupI18nConfig(format: keyof typeof formats = 'xlf') {
248248
for (const { lang, translationReplacements } of langTranslations) {
249249
if (lang != sourceLocale) {
250250
await copyFile(translationFile, `src/locale/messages.${lang}.${formats[format].ext}`);
251+
// @ts-ignore
251252
for (const replacements of translationReplacements) {
252253
await replaceInFile(
253254
`src/locale/messages.${lang}.${formats[format].ext}`,

tests/legacy-cli/e2e/tests/misc/completion-prompt.ts

+17
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export default async function () {
3434
const { stdout } = await execWithEnv(
3535
'ng',
3636
['version'],
37+
// @ts-ignore
3738
{
3839
...DEFAULT_ENV,
3940
SHELL: '/bin/bash',
@@ -66,6 +67,7 @@ export default async function () {
6667
const { stdout } = await execWithEnv(
6768
'ng',
6869
['version'],
70+
// @ts-ignore
6971
{
7072
...DEFAULT_ENV,
7173
SHELL: '/bin/bash',
@@ -104,6 +106,7 @@ export default async function () {
104106
const { stdout: stdout1 } = await execWithEnv(
105107
'ng',
106108
['version'],
109+
// @ts-ignore
107110
{
108111
...DEFAULT_ENV,
109112
SHELL: '/bin/bash',
@@ -127,6 +130,7 @@ export default async function () {
127130
// User modifies their configuration and removes `ng completion`.
128131
await fs.writeFile(bashrc, '# Some new commands...');
129132

133+
// @ts-ignore
130134
const { stdout: stdout2 } = await execWithEnv('ng', ['version'], {
131135
...DEFAULT_ENV,
132136
SHELL: '/bin/bash',
@@ -157,6 +161,7 @@ export default async function () {
157161
const { stdout: stdout1 } = await execWithEnv(
158162
'ng',
159163
['version'],
164+
// @ts-ignore
160165
{
161166
...DEFAULT_ENV,
162167
SHELL: '/bin/bash',
@@ -169,6 +174,7 @@ export default async function () {
169174
throw new Error('First execution did not prompt for autocompletion setup.');
170175
}
171176

177+
// @ts-ignore
172178
const { stdout: stdout2 } = await execWithEnv('ng', ['version'], {
173179
...DEFAULT_ENV,
174180
SHELL: '/bin/bash',
@@ -203,6 +209,7 @@ export default async function () {
203209
const err = await execAndCaptureError(
204210
'ng',
205211
['version'],
212+
// @ts-ignore
206213
{
207214
...DEFAULT_ENV,
208215
SHELL: '/bin/bash',
@@ -223,6 +230,7 @@ export default async function () {
223230
const { stdout: stdout2 } = await execWithEnv(
224231
'ng',
225232
['version'],
233+
// @ts-ignore
226234
{
227235
...DEFAULT_ENV,
228236
SHELL: '/bin/bash',
@@ -249,6 +257,7 @@ export default async function () {
249257

250258
// Does *not* prompt for `ng update` commands.
251259
await mockHome(async (home) => {
260+
// @ts-ignore
252261
// Use `ng update --help` so it's actually a no-op and we don't need to setup a project.
253262
const { stdout } = await execWithEnv('ng', ['update', '--help'], {
254263
...DEFAULT_ENV,
@@ -262,6 +271,7 @@ export default async function () {
262271

263272
// Does *not* prompt for `ng completion` commands.
264273
await mockHome(async (home) => {
274+
// @ts-ignore
265275
const { stdout } = await execWithEnv('ng', ['completion'], {
266276
...DEFAULT_ENV,
267277
HOME: home,
@@ -277,6 +287,7 @@ export default async function () {
277287
const { stdout } = await execWithEnv('ng', ['version'], {
278288
...DEFAULT_ENV,
279289
CI: 'true',
290+
// @ts-ignore
280291
NG_FORCE_TTY: undefined,
281292
});
282293

@@ -287,6 +298,7 @@ export default async function () {
287298

288299
// Does *not* prompt user for non-TTY executions.
289300
{
301+
// @ts-ignore
290302
const { stdout } = await execWithEnv('ng', ['version'], {
291303
...DEFAULT_ENV,
292304
NG_FORCE_TTY: 'false',
@@ -301,6 +313,7 @@ export default async function () {
301313
{
302314
const { stdout } = await execWithEnv('ng', ['version'], {
303315
...DEFAULT_ENV,
316+
// @ts-ignore
304317
HOME: undefined,
305318
});
306319

@@ -316,6 +329,7 @@ export default async function () {
316329
{
317330
const { stdout } = await execWithEnv('ng', ['version'], {
318331
...DEFAULT_ENV,
332+
// @ts-ignore
319333
SHELL: undefined,
320334
});
321335

@@ -329,6 +343,7 @@ export default async function () {
329343

330344
// Does *not* prompt user for executions from unknown shells.
331345
{
346+
// @ts-ignore
332347
const { stdout } = await execWithEnv('ng', ['version'], {
333348
...DEFAULT_ENV,
334349
SHELL: '/usr/bin/unknown',
@@ -355,6 +370,7 @@ source <(ng completion script)
355370
`.trim(),
356371
);
357372

373+
// @ts-ignore
358374
const { stdout } = await execWithEnv('ng', ['version'], {
359375
...DEFAULT_ENV,
360376
SHELL: '/bin/bash',
@@ -376,6 +392,7 @@ async function windowsTests(): Promise<void> {
376392
const bashrc = path.join(home, '.bashrc');
377393
await fs.writeFile(bashrc, `# Other content...`);
378394

395+
// @ts-ignore
379396
const { stdout } = await execWithEnv('ng', ['version'], { ...env });
380397

381398
if (AUTOCOMPLETION_PROMPT.test(stdout)) {

tests/legacy-cli/e2e/tests/misc/completion.ts

+2
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,7 @@ source <(ng completion script)
302302
const err = await execAndCaptureError('ng', ['completion'], {
303303
...process.env,
304304
SHELL: '/bin/bash',
305+
// @ts-ignore
305306
HOME: undefined,
306307
});
307308
if (!err.message.includes('`$HOME` environment variable not set.')) {
@@ -313,6 +314,7 @@ source <(ng completion script)
313314
await mockHome(async (home) => {
314315
const err = await execAndCaptureError('ng', ['completion'], {
315316
...process.env,
317+
// @ts-ignore
316318
SHELL: undefined,
317319
HOME: home,
318320
});

tests/legacy-cli/e2e/tests/misc/coverage.ts

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export default function () {
1010

1111
return (
1212
ng('test', '--watch=false', '--code-coverage')
13+
// @ts-ignore
1314
.then((output) => expect(output.stdout).toContain('Coverage summary'))
1415
.then(() => expectFileToExist('coverage/src/app'))
1516
.then(() => expectFileToExist('coverage/lcov.info'))

tests/legacy-cli/e2e/tests/misc/e2e-host.ts

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { killAllProcesses, ng } from '../../utils/process';
33
import { updateJsonFile } from '../../utils/project';
44

55
export default async function () {
6+
// @ts-ignore
67
const interfaces = [].concat.apply([], Object.values(os.networkInterfaces()));
78
let host = '';
89
for (const { family, address, internal } of interfaces) {

tests/legacy-cli/e2e/tests/misc/proxy-config.ts

+3
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,19 @@ export default function () {
1818
const server = http.createServer(app);
1919
server.listen(0);
2020

21+
// @ts-ignore
2122
app.set('port', (server.address() as AddressInfo).port);
2223
app.get('/api/test', function (req, res) {
2324
res.send('TEST_API_RETURN');
2425
});
2526

2627
const backendHost = 'localhost';
28+
// @ts-ignore
2729
const backendPort = (server.address() as AddressInfo).port;
2830
const proxyServerUrl = `http://${backendHost}:${backendPort}`;
2931
const proxyConfigFile = 'proxy.config.json';
3032
const proxyConfig = {
33+
// @ts-ignore
3134
'/api/*': {
3235
target: proxyServerUrl,
3336
},

tests/legacy-cli/e2e/tests/misc/public-host.ts

+2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ export default function () {
88

99
const firstLocalIp = Object.values(os.networkInterfaces())
1010
.flat()
11+
// @ts-ignore
1112
.filter((ni) => ni.family === 'IPv4' && !ni.internal)
13+
// @ts-ignore
1214
.map((ni) => ni.address)
1315
.shift();
1416
const publicHost = `${firstLocalIp}:4200`;

tests/legacy-cli/e2e/tests/update/update-secure-registry.ts

+3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export default async function () {
88
delete process.env['NPM_CONFIG_REGISTRY'];
99
const worksMessage = 'We analyzed your package.json';
1010

11+
// @ts-ignore
1112
const extraArgs = [];
1213
if (isPrereleaseCli()) {
1314
extraArgs.push('--next');
@@ -28,8 +29,10 @@ export default async function () {
2829

2930
// Invalid authentication token
3031
await createNpmConfigForAuthentication(false, true);
32+
// @ts-ignore
3133
await expectToFail(() => ng('update', ...extraArgs));
3234

3335
await createNpmConfigForAuthentication(true, true);
36+
// @ts-ignore
3437
await expectToFail(() => ng('update', ...extraArgs));
3538
}

0 commit comments

Comments
 (0)