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

Lines changed: 70 additions & 2 deletions

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

Lines changed: 1 addition & 0 deletions
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

Lines changed: 1 addition & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 1 addition & 0 deletions
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

Lines changed: 3 additions & 0 deletions
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

Lines changed: 8 additions & 0 deletions
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

Lines changed: 3 additions & 0 deletions
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

Lines changed: 1 addition & 0 deletions
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}`,

0 commit comments

Comments
 (0)