How to use the karma.stopper function in karma

To help you get started, we’ve selected a few karma examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gms1 / node-sqlite3-orm / build / gulp / OperationKarma.js View on Github external
'use strict';

const KarmaServer = require('karma').Server;
const karmaStopper = require('karma').stopper;
const path = require('path');

const defaultTimeout = 100000;

// I have a similar issue, but this is alread closed:
// Karma doesn't exit properly when using public api with the finish callback #1035
// https://github.com/karma-runner/karma/issues/1035


var OperationKarma = (function() {
  function OperationKarma(config, op) {
    this.config = config;
    this.op = op;

    this.timeout = this.op.timeout || defaultTimeout;
github Raagh / angular-karma_test-explorer / src / core / karma / karma-runner.ts View on Github external
return new Promise(resolve => {
      const stopper = require("karma").stopper;
      stopper.stop({ port: 9876 }, (exitCode: any) => {
        resolve();
      });
    });
  }
github Raagh / angular-karma_test-explorer / src / core / karma / karma-server.ts View on Github external
return new Promise(resolve => {
      if (this.karmaEventListener.isServerLoaded) {
        const stopper = require("karma").stopper;
        stopper.stop({ port: 9876 }, (exitCode: number) => {
          this.logger.info(`Karma exited succesfully`);
          resolve();
          this.karmaEventListener.stopListeningToKarma();
        });
      }
    });
  }
github chialab / rna-cli / commands / unit / action.js View on Github external
server.on('listening', (port) => {
                    let browsers = server.get('config').browsers;
                    if (!browsers || browsers.length === 0) {
                        karma.stopper.stop({ port });
                    }
                });
            }
github chialab / rna-cli / lib / TestRunners / BrowserTestRunner.js View on Github external
return new Promise((resolve) => {
                karma.stopper.stop(this.server, resolve);
            });
        }