| Conditions | 1 |
| Paths | 1 |
| Total Lines | 71 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
| 1 | // Karma configuration |
||
| 8 | module.exports = function (config) { |
||
| 9 | config.set({ |
||
| 10 | |||
| 11 | // base path that will be used to resolve all patterns (eg. files, exclude) |
||
| 12 | basePath: '.', |
||
| 13 | |||
| 14 | |||
| 15 | // frameworks to use |
||
| 16 | // available frameworks: https://npmjs.org/browse/keyword/karma-adapter |
||
| 17 | frameworks: ['jasmine'], |
||
| 18 | |||
| 19 | |||
| 20 | // list of files / patterns to load in the browser |
||
| 21 | files: [ |
||
| 22 | '../../core/vendor/jquery/dist/jquery.js', |
||
| 23 | '../../core/vendor/underscore/underscore.js', |
||
| 24 | 'js/vendor/angular/angular.min.js', |
||
| 25 | 'tests/unit/js/mocks/*.js', |
||
| 26 | 'js/vendor/angular-mocks/angular-mocks.js', |
||
| 27 | 'js/vendor/**/*.js', |
||
| 28 | 'js/app/**/*.js', |
||
| 29 | { pattern: 'tests/unit/js/app/**/*.js', included: true } |
||
| 30 | ], |
||
| 31 | |||
| 32 | |||
| 33 | // list of files to exclude |
||
| 34 | exclude: [ |
||
| 35 | 'js/vendor/angular-mocks/ngAnimateMock.js', |
||
| 36 | 'js/vendor/angular-mocks/ngMock.js', |
||
| 37 | 'js/vendor/angular-mocks/ngMockE2E.js' |
||
| 38 | ], |
||
| 39 | |||
| 40 | |||
| 41 | // preprocess matching files before serving them to the browser |
||
| 42 | // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor |
||
| 43 | preprocessors: {}, |
||
| 44 | |||
| 45 | |||
| 46 | // test results reporter to use |
||
| 47 | // possible values: 'dots', 'progress' |
||
| 48 | // available reporters: https://npmjs.org/browse/keyword/karma-reporter |
||
| 49 | reporters: ['verbose'], |
||
| 50 | |||
| 51 | |||
| 52 | // web server port |
||
| 53 | port: 9876, |
||
| 54 | |||
| 55 | |||
| 56 | // enable / disable colors in the output (reporters and logs) |
||
| 57 | colors: true, |
||
| 58 | |||
| 59 | |||
| 60 | // level of logging |
||
| 61 | // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG |
||
| 62 | logLevel: config.LOG_INFO, |
||
| 63 | |||
| 64 | |||
| 65 | // enable / disable watching file and executing tests whenever any file changes |
||
| 66 | autoWatch: false, |
||
| 67 | |||
| 68 | |||
| 69 | // start these browsers |
||
| 70 | // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher |
||
| 71 | browsers: browsers, |
||
| 72 | |||
| 73 | |||
| 74 | // Continuous Integration mode |
||
| 75 | // if true, Karma captures browsers, runs the tests and exits |
||
| 76 | singleRun: true |
||
| 77 | }); |
||
| 78 | }; |
||
| 79 |