lathonez / clicker

Ionic 2 + @angular/cli Seed Project : Angular2 + Typescript + Karma + Protractor + Travis
http://lathonez.com/2018/ionic-2-unit-testing/
MIT License
430 stars 136 forks source link

Need to shut down the angular-cli karma test runner once all test cases has completed. #209

Closed Asiq closed 7 years ago

Asiq commented 7 years ago

I tried by using the singleRun: true even though it is not disconnected after completed the test cases.

Could you please help me out on this.

My karma-conf file here:

// Karma configuration file, see link for more information // https://karma-runner.github.io/0.13/config/configuration-file.html

module.exports = function (config) { config.set({ basePath: '', frameworks: ['jasmine', 'angular-cli'], plugins: [ require('karma-jasmine'), require('karma-chrome-launcher'), require('karma-remap-istanbul'), require('karma-mocha-reporter'), require('angular-cli/plugins/karma') ], files: [ { pattern: './src/test.ts', watched: false } ], preprocessors: { './src/test.ts': ['angular-cli'] }, mime: { 'text/x-typescript': ['ts','tsx'] }, remapIstanbulReporter: { reports: { html: 'coverage', lcovonly: './coverage/coverage.lcov' } }, angularCli: { config: './angular-cli.json', environment: 'dev' }, reporters: config.angularCli && config.angularCli.codeCoverage ? ['mocha', 'karma-remap-istanbul'] : ['mocha'], port: 9876, colors: true, logLevel: config.LOG_INFO, autoWatch: true, cordovaSettings: { platforms: ['android', 'ios'], mode: 'emulate', hostip: '10.0.2.2', target: '0468de2a213eae29', plugins: [ 'org.apache.cordova.console' ] }, browsers: ['Chrome'], singleRun: true }); };

lathonez commented 7 years ago

https://github.com/lathonez/clicker/blob/master/.travis.yml#L43

Should sort you out. Try looking at the ng-cli docs

Asiq commented 7 years ago

Thanks a lot lathonez, Now it is fixed. :+1: