DEV Community

Pablo
Pablo

Posted on

2

Angular Tests

I'm trying to figure it out why I'm getting DISCONNECTED while running my tests.

So I did this to see what's been tested:

npm i karma-spec-reporter --save-dev

karma.conf.js

plugins: [require('karma-spec-reporter'), ...],
reporters: ['spec', ...],
specReporter: {
    maxLogLines: 5, // limit number of lines logged per test
    suppressErrorSummary: true, // do not print error summary
    suppressFailed: false, // do not print information about failed tests
    suppressPassed: false, // do not print information about passed tests
    suppressSkipped: true, // do not print information about skipped tests
    showSpecTiming: false // print the time elapsed for each spec
},

https://stackoverflow.com/a/58202615/1958882

And added this:
captureTimeout: 210000,
browserDisconnectTolerance: 3, 
browserDisconnectTimeout : 210000,
browserNoActivityTimeout : 210000,

https://github.com/jasmine/jasmine/issues/1413#issuecomment-334247097

browsers: ["Chrome-headless"],
customLaunchers: {
    "Chrome-headless": {
        base: 'Chrome',
        flags: [
            '--no-sandbox',
            '--disable-gpu',
            '--enable-logging',
            '--no-default-browser-check',
            '--no-first-run',
            '--disable-default-apps',
            '--disable-popup-blocking',
            '--disable-translate',
            '--disable-background-timer-throttling',
            '--disable-renderer-backgrounding',
            '--disable-device-discovery-notifications',
            '--remote-debugging-port=9222',
            '--disable-web-security',
            '--watch=false'
        ]
    }
},

https://github.com/jasmine/jasmine/issues/1413#issuecomment-432112670

And still, this damn thing it's not working... 😑

Avoid karma tests running twice on autoWatch
autoWatch: false,

https://pracucci.com/avoid-karma-tests-run-twice-on-autowatch.html

AWS GenAI LIVE image

Real challenges. Real solutions. Real talk.

From technical discussions to philosophical debates, AWS and AWS Partners examine the impact and evolution of gen AI.

Learn more

Top comments (0)

Sentry image

See why 4M developers consider Sentry, β€œnot bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

πŸ‘‹ Kindness is contagious

Please leave a ❀️ or a friendly comment on this post if you found it helpful!

Okay