Reinhard
Reinhard

Reputation: 1746

How to disable search engine choice screen?

Using karma for unit-testing in an Angular project works fine. With a new Chrome version a "search engine selection" windows pops up on each npm run test.

How to disable this ?

Upvotes: 6

Views: 1055

Answers (2)

Yozi
Yozi

Reputation: 12755

I'll add some information relevant to Angular 18 to @Reinhard's response.

If your project doesn't yet have a karma.config.js file, you can create it by running the command:

ng generate config karma

This command will create a file with default settings and will also add a reference to it in angular.json.

Next, in karma.config.js, follow Reinhard's advice and replace

browsers: ['Chrome'],

Upvotes: 1

Reinhard
Reinhard

Reputation: 1746

There is a command-line-argument disable-search-engine-choice-screen that disables that popup. using that argument is a little bit tricky (use the right number of dashes)

in the file karma.config.js replace

   browsers: ['Chrome'],

with:

    browsers: ["MyChromeWithoutSearchSelect"],
    customLaunchers: {
      MyChromeWithoutSearchSelect: {
        base: "Chrome",
        flags: ["-disable-search-engine-choice-screen"],
      },
    },

Upvotes: 9

Related Questions