Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an npm script to perform ng test with chrome headless #162

Closed
mrmeku opened this issue Dec 15, 2017 · 4 comments
Closed

Add an npm script to perform ng test with chrome headless #162

mrmeku opened this issue Dec 15, 2017 · 4 comments

Comments

@mrmeku
Copy link
Contributor

mrmeku commented Dec 15, 2017

This is a likely prerequisite for implementing a lot of the CI code we want to bake into NX. As I figure out the correct way to do this for an individual project I will bake this into NX so that everyone else can benefit from my labor. @vsavkin Do you think this is a good feature to integrate into NX?

@chaosmonster
Copy link

Replace in your karma.conf.js the following line browsers: ['Chrome'], with

browsers: ['ChromeHeadless'],
    customLaunchers: {
      ChromeHeadless: {
        base: 'Chrome',
        flags: [
          '--disable-translate',
          '--headless',
          '--disable-gpu',
          '--disable-extensions',
          '--remote-debugging-port=9222'
        ]
      }
    }

This is not part of nx in my opinion, as said file is generated by the angular-cli

@MitkoTschimev
Copy link
Contributor

MitkoTschimev commented Dec 21, 2017

There are multiple ways to do this and i recommend to use puppeteer to not have a system chrome dependency.

npm install puppeteer

// karma.conf.js
process.env.CHROME_BIN = require('puppeteer').executablePath();

...

browsers: ['ChromeHeadless']

@vsavkin
Copy link
Member

vsavkin commented Apr 24, 2018

I think it is a useful edition, but it has two downsides:

  • Nx deviates from the default CLI setup
  • Whereas the dev support tends to be somewhat similar for most folks, the CI configuration can differ a lot. So I'm not sure if we can provide one configuration that is good for everyone.

So I'm closing this.

@vsavkin vsavkin closed this as completed Apr 24, 2018
FrozenPandaz added a commit to FrozenPandaz/nx that referenced this issue Jan 12, 2023
@github-actions
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants