Skip to content

Commit 3153f7c

Browse files
alan-agius4clydin
authored andcommitted
ci: remove flakey test behaviour
During testing architect isn't spawned as a new process therefore we the global state can be tained from previous runs. `es5TargetWarningsShown` which was saved in the global state caused flakiness.
1 parent 34ecf66 commit 3153f7c

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

packages/angular_devkit/build_angular/src/builders/browser/tests/behavior/typescript-target_spec.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -243,11 +243,11 @@ describeBuilder(buildWebpackBrowser, BROWSER_BUILDER_INFO, (harness) => {
243243
const { result, logs } = await harness.executeOnce();
244244
expect(result?.success).toBeTrue();
245245

246-
const deprecationMessages = logs.filter(({ message }) =>
247-
message.startsWith('DEPRECATED: ES5 output is deprecated'),
246+
expect(logs).toContain(
247+
jasmine.objectContaining<logging.LogEntry>({
248+
message: jasmine.stringMatching('DEPRECATED: ES5 output is deprecated'),
249+
}),
248250
);
249-
250-
expect(deprecationMessages).toHaveSize(1);
251251
});
252252
});
253253
});

packages/angular_devkit/build_angular/src/webpack/plugins/typescript.ts

+3-8
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ function ensureIvy(wco: WebpackConfigOptions): void {
2626
wco.tsConfig.options.enableIvy = true;
2727
}
2828

29-
let es5TargetWarningsShown = false;
3029
export function createIvyPlugin(
3130
wco: WebpackConfigOptions,
3231
aot: boolean,
@@ -54,13 +53,9 @@ export function createIvyPlugin(
5453
// as for third-party libraries. This greatly reduces the complexity of static analysis.
5554
if (wco.scriptTarget < ScriptTarget.ES2015) {
5655
compilerOptions.target = ScriptTarget.ES2015;
57-
if (!es5TargetWarningsShown) {
58-
wco.logger.warn(
59-
'DEPRECATED: ES5 output is deprecated. Please update TypeScript `target` compiler option to ES2015 or later.',
60-
);
61-
62-
es5TargetWarningsShown = true;
63-
}
56+
wco.logger.warn(
57+
'DEPRECATED: ES5 output is deprecated. Please update TypeScript `target` compiler option to ES2015 or later.',
58+
);
6459
}
6560

6661
const fileReplacements: Record<string, string> = {};

0 commit comments

Comments
 (0)