Skip to content

Commit

Permalink
test: remove disableTypeScriptVersionCheck from tests setup
Browse files Browse the repository at this point in the history
This option causes our CI to be green even when new projects are created with mismatching TypeScript versions, which causes failures in a real-world project.

See #22333 for more context.

(cherry picked from commit fb3b1fe)
  • Loading branch information
alan-agius4 committed Dec 11, 2021
1 parent 1ddbd75 commit 625ed49
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 16 deletions.
11 changes: 1 addition & 10 deletions tests/legacy-cli/e2e/setup/500-create-project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { setRegistry as setNPMConfigRegistry } from '../utils/packages';
import { ng, npm } from '../utils/process';
import { prepareProjectForE2e, updateJsonFile } from '../utils/project';

export default async function() {
export default async function () {
const argv = getGlobalVariable('argv');

if (argv.noproject) {
Expand All @@ -28,15 +28,6 @@ export default async function() {
await expectFileToExist(join(process.cwd(), 'test-project'));
process.chdir('./test-project');

// Disable the TS version check to make TS updates easier.
// Only VE does it, but on Ivy the i18n extraction uses VE.
await updateJsonFile('tsconfig.json', config => {
if (!config.angularCompilerOptions) {
config.angularCompilerOptions = {};
}
config.angularCompilerOptions.disableTypeScriptVersionCheck = true;
});

// If on CI, the user configuration set above will handle project usage
if (!isCI) {
// Ensure local test registry is used inside a project
Expand Down
8 changes: 2 additions & 6 deletions tests/legacy-cli/e2e/tests/i18n/ivy-localize-es2015.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,14 @@ import { updateJsonFile } from '../../utils/project';
import { expectToFail } from '../../utils/utils';
import { externalServer, langTranslations, setupI18nConfig } from './setup';

export default async function() {
export default async function () {
// Setup i18n tests and config.
await setupI18nConfig();

// Ensure a es2017 build is used.
await writeFile('.browserslistrc', 'Chrome 65');
await updateJsonFile('tsconfig.json', config => {
await updateJsonFile('tsconfig.json', (config) => {
config.compilerOptions.target = 'es2017';
if (!config.angularCompilerOptions) {
config.angularCompilerOptions = {};
}
config.angularCompilerOptions.disableTypeScriptVersionCheck = true;
});

await ng('build', '--source-map');
Expand Down

0 comments on commit 625ed49

Please sign in to comment.