Gathering detailed insights and metrics for karma-mocha-reporter
Gathering detailed insights and metrics for karma-mocha-reporter
Gathering detailed insights and metrics for karma-mocha-reporter
Gathering detailed insights and metrics for karma-mocha-reporter
@types/karma-mocha-reporter
TypeScript definitions for karma-mocha-reporter
karma-mocha-clean-reporter
Karma reporter with mocha style logging, formatted a la rstacruz/mocha-clean. Forked from litixsoft/karma-mocha-clean.
karma-mocha-own-reporter
Karma plugin to make possible to use Mocha own reporters.
karma-mocha-html-annotations-reporter
karma+mocha html reporter with html annotations
Karma reporter plugin with mocha style logging.
npm install karma-mocha-reporter
Typescript
Module System
Node Version
NPM Version
81.1
Supply Chain
95.2
Quality
71.2
Maintenance
100
Vulnerability
98.2
License
JavaScript (100%)
Total Downloads
107,408,966
Last Day
16,854
Last Week
290,928
Last Month
1,234,309
Last Year
13,661,922
NOASSERTION License
197 Stars
195 Commits
45 Forks
8 Watchers
9 Branches
27 Contributors
Updated on May 02, 2024
Minified
Minified + Gzipped
Latest Version
2.2.5
Package Id
karma-mocha-reporter@2.2.5
Size
10.44 kB
NPM Version
4.0.3
Node Version
6.9.1
Published on
Oct 17, 2017
Cumulative downloads
Total Downloads
Last Day
-21.4%
16,854
Compared to previous day
Last Week
-6.6%
290,928
Compared to previous week
Last Month
4.5%
1,234,309
Compared to previous month
Last Year
3.3%
13,661,922
Compared to previous year
3
1
24
Karma reporter plugin with mocha style logging.
The easiest way is to keep karma-mocha-reporter
as a devDependency in your package.json
.
1{ 2 "devDependencies": { 3 "karma": "^1.0.0", 4 "karma-mocha-reporter": "^2.0.0" 5 } 6}
You can simply do it by:
$ npm install karma-mocha-reporter --save-dev
1// karma.conf.js 2module.exports = function(config) { 3 config.set({ 4 frameworks: ['jasmine'], 5 6 // reporters configuration 7 reporters: ['mocha'] 8 }); 9};
Type: Object | Boolean
Lets you overwrite the default colors. Possible values are all colors and background colors from chalk.
Possible Values:
Value | Description | Default |
---|---|---|
success | success messages | green |
info | info messages | grey |
warning | warn messages | yellow |
error | error messages | red |
1// karma.conf.js 2module.exports = function(config) { 3 config.set({ 4 frameworks: ['jasmine'], 5 6 // reporters configuration 7 reporters: ['mocha'], 8 9 // reporter options 10 mochaReporter: { 11 colors: { 12 success: 'blue', 13 info: 'bgGreen', 14 warning: 'cyan', 15 error: 'bgRed' 16 }, 17 symbols: { 18 success: '+', 19 info: '#', 20 warning: '!', 21 error: 'x' 22 } 23 } 24 }); 25};
To disable the colors please use the colors
option in the karma config.
1// karma.conf.js 2module.exports = function(config) { 3 config.set({ 4 frameworks: ['jasmine'], 5 6 // reporters configuration 7 reporters: ['mocha'], 8 9 // disable colors 10 colors: false 11 }); 12};
Type: Object
Lets you overwrite the default symbols.
Possible Values:
Value | Description | Default |
---|---|---|
success | success messages | ✔ |
info | info messages | ℹ |
warning | warn messages | ⚠ |
error | error messages | ✖ |
1// karma.conf.js 2module.exports = function(config) { 3 config.set({ 4 frameworks: ['jasmine'], 5 6 // reporters configuration 7 reporters: ['mocha'], 8 9 // reporter options 10 mochaReporter: { 11 symbols: { 12 success: '+', 13 info: '#', 14 warning: '!', 15 error: 'x' 16 } 17 } 18 }); 19};
Type: String
Possible Values:
Value | Description |
---|---|
full (default) | all output is printed to the console |
autowatch | first run will have the full output and the next runs just output the summary and errors in mocha style |
minimal | only the summary and errors are printed to the console in mocha style |
noFailures | the failure details are not logged |
1// karma.conf.js 2module.exports = function(config) { 3 config.set({ 4 frameworks: ['jasmine'], 5 6 // reporters configuration 7 reporters: ['mocha'], 8 9 // reporter options 10 mochaReporter: { 11 output: 'autowatch' 12 } 13 }); 14};
Type: String | Boolean
Shows a diff output. Is disabled by default. All credits to the contributors of mocha, since the diff logic is used from there and customized for this module.
Currently only works with karma-mocha >= v0.2.2 Not supported for karma-jasmine since the additional properties needed to render the diff are not supported in jasmine yet.
Possible Values:
Value | Description |
---|---|
true | prints each diff in its own line, same as 'unified' |
'unified' | prints each diff in its own line |
'inline' | prints diffs inline |
1// karma.conf.js 2module.exports = function(config) { 3 config.set({ 4 frameworks: ['mocha', 'chai'], 5 6 // reporters configuration 7 reporters: ['mocha'], 8 9 // reporter options 10 mochaReporter: { 11 showDiff: true 12 } 13 }); 14};
Type: String
Default: 80 equals signs ('=')
The string to output between multiple test runs. Set to false
or empty string to disable
1// karma.conf.js 2module.exports = function(config) { 3 config.set({ 4 frameworks: ['jasmine'], 5 6 // reporters configuration 7 reporters: ['mocha'], 8 9 // reporter options 10 mochaReporter: { 11 divider: '' 12 } 13 }); 14};
Type: Boolean
Possible Values:
false
(default)true
When setting the ignoreSkipped flag to true, the reporter will ignore the skipped tests in the output and you will see only the tests that where really executed. The summary will still contain the number of skipped tests.
Type: Number
Lets you set the maximum number of lines which are printed for a failure. The default value is 999. Helps to cut long stack traces.
Set the value to -1
to disable stack traces.
Type: Boolean
Possible Values:
false
(default)true
Prints the result of an it block after it is run in one browser. This options is useful when you have tests which are conditionally run in one browser only. Otherwise the result of the it block would not be printed because it was not run in all browsers.
1// testfile.spec.js 2if (navigator.userAgent.match(/firefox/i)) { 3 describe('Firefox tests', function() { 4 it('this would only be reported when printFirstSuccess is true', function() { 5 console.log('firefox test'); 6 }); 7 }); 8} 9 10describe('Other tests', function() { 11 it('this should be always reported', function() { 12 console.log('hello world'); 13 }); 14});
In lieu of a formal styleguide take care to maintain the existing coding style. Lint and test your code using grunt.
You can preview your changes by running:
$ npm run demo
Copyright (C) 2013-2017 Litixsoft GmbH info@litixsoft.de Licensed under the MIT license.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included i all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 7/22 approved changesets -- score normalized to 3
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-06-23
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More