Skip to content

Commit 50c79cf

Browse files
committed
test: reduce karma test flakes by using clearContext that is set in the builder
This is needed as a workaround for #28271
1 parent d9468a6 commit 50c79cf

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

modules/testing/builder/projects/hello-world-app/karma.conf.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ module.exports = function(config) {
2323
require('karma-coverage'),
2424
require('@angular-devkit/build-angular/plugins/karma'),
2525
],
26-
client: {
27-
clearContext: false, // leave Jasmine Spec Runner output visible in browser
28-
},
2926
jasmineHtmlReporter: {
3027
suppressAll: true // removes the duplicated traces
3128
},

packages/angular/build/src/builders/application/tests/options/polyfills_spec.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => {
2020
for (const [suitName, baseUrl] of testsVariants) {
2121
describe(suitName, () => {
2222
beforeEach(async () => {
23+
beforeEach(async () => {
24+
await harness.writeFile('src/main.ts', 'console.log("TEST");');
25+
});
26+
2327
await harness.modifyFile('tsconfig.json', (content) => {
2428
const tsconfig = JSON.parse(content);
2529
tsconfig.compilerOptions.baseUrl = baseUrl;

packages/angular_devkit/build_angular/test/hello-world-lib/projects/lib/karma.conf.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ module.exports = function (config) {
2020
require('karma-coverage-istanbul-reporter'),
2121
require('@angular-devkit/build-angular/plugins/karma')
2222
],
23-
client: {
24-
clearContext: false // leave Jasmine Spec Runner output visible in browser
25-
},
2623
jasmineHtmlReporter: {
2724
suppressAll: true // removes the duplicated traces
2825
},

0 commit comments

Comments
 (0)