Comments (10)
You are setting the option incorrectly. It should be a function or regex. Try this
aggregatedReporterTest: /coverage|brief|istanbul|junit/i
from karma-parallel.
That doesn't work either. I get this error:
NaN pending 10 05 2019 14:13:31.289:ERROR [karma-server]: TypeError: Cannot read property 'toString' of undefined
at padNumber (C:\git\angularWebApp\node_modules\karma-brief-reporter\lib\util\printers.js:7:21)
at printStats (C:\git\angularWebApp\node_modules\karma-brief-reporter\lib\util\printers.js:13:19)
at Object.exports.printProgress (C:\git\angularWebApp\node_modules\karma-brief-reporter\lib\util\printers.js:28:3)
at Brief.onSpecComplete (C:\git\angularWebApp\node_modules\karma-brief-reporter\lib\brief.js:45:16)
at reporters.forEach (C:\git\angularWebApp\node_modules\karma-parallel\lib\reporter.js:61:26)
at Array.forEach (<anonymous>)
at AggregatedCoverageReporter._.rest (C:\git\angularWebApp\node_modules\karma-parallel\lib\reporter.js:58:15)
at apply (C:\git\angularWebApp\node_modules\lodash\lodash.js:475:27)
at C:\git\angularWebApp\node_modules\lodash\lodash.js:6569:16
at AggregatedCoverageReporter.onSpecComplete (C:\git\angularWebApp\node_modules\karma-parallel\lib\reporter.js:121:7)
at Server.<anonymous> (C:\git\angularWebApp\node_modules\karma\lib\events.js:40:26)
at Server.emit (events.js:194:15)
at Browser.onResult (C:\git\angularWebApp\node_modules\karma\lib\browser.js:164:20)
at Socket.socket.on (C:\git\angularWebApp\node_modules\karma\lib\browser.js:214:42)
at Socket.emit (events.js:189:13)
at C:\git\angularWebApp\node_modules\socket.io\lib\socket.js:528:12
Cannot read property 'success' of undefined
TypeError: Cannot read property 'success' of undefined
at TestCommand.runSingleTarget (C:\git\angularWebApp\node_modules\@angular\cli\models\packages\angular\cli\models\architect-command.ts:242:21)
at process._tickCallback (internal/process/next_tick.js:68:7)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] test-fast: `ng test --sourceMap=false --karmaConfig=src/karma.conf.fast.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] test-fast script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
from karma-parallel.
Any other suggestions on how to resolve?
from karma-parallel.
Hi Joel,
I am also looking for help to get the code coverage (aggregated one) using karma-parallel. Kindly share sample karma.conf.js. Thanks in advance!!
from karma-parallel.
We had similar issues using istanbul reporter. I got it working by adjusting lib/reporter.js:
--- a/lib/reporter.js
+++ b/lib/reporter.js
@@ -106,11 +106,8 @@ const AggregatedCoverageReporter = function(injector, logger, config, baseReport
delete aggregate.alias.lastResult._realLastResults[browser.id];
aggregate.real[browser.id] = UNSTARTED;
-
- // Call through on the very first browser start
- if (getStartedBrowserCount(aggregate) === 1) {
- callThrough('onBrowserStart', aggregate.alias);
- }
+
+ callThrough('onBrowserStart', aggregate.alias);
};
this.onSpecComplete = function (browser, result) {
would be nice if anybody could explain me the reason for the if-condition.
from karma-parallel.
I ended up adding this getters to the AggegatedBrowserLastResult. No need to comment out the if below. I wonder how best to proceed with the changes.
get success() {
return _.sum(
_.map(this._realLastResults, 'success')
)
}
get skipped() {
return _.sum(
_.map(this._realLastResults, 'skipped')
)
}
@jo-soft How did you override the lib inside of your project ?
from karma-parallel.
@MikeDabrowski basically creating a local fork and adjusting it (after testing it by adjusting local node_modules). but it look like you figured out something
from karma-parallel.
from karma-parallel.
it's easy to avoid lodash:
get success() {
return _.sum(
_realLastResults.map( result => result.success )
)
}
get skipped() {
return _.sum(
_realLastResults.map( result => result.skipped )
)
}
from karma-parallel.
it's easy to avoid lodash
in some places, yes.
get total() {
return R.sum(Object.values(this._realLastResults).map(R.prop('total')));
}
get failed() {
return R.sum(Object.values(this._realLastResults).map(R.prop('failed')));
}
get success() {
return R.sum(Object.values(this._realLastResults).map(R.prop('success')));
}
get skipped() {
return R.sum(Object.values(this._realLastResults).map(R.prop('skipped')));
}
get netTime() {
return R.apply(
Math.max,
Object.values(this._realLastResults).map(R.prop('netTime')),
);
}
But there is this piece for example:
const callThrough = _.rest((fnName, args) => {
reporters.forEach(({name, reporter}) => {
if (_.isFunction(reporter[fnName])) {
log.debug(`relaying ${fnName}() on reporter:${name}`);
reporter[fnName].apply(reporter, args);
}
});
});
I am sure it is possible to use ramda / native-js for this but I just did not want to invest more time in it.
Lodash's functions that are still used: rest
, chain
, size
, extendWith
, isFunction
, map
from karma-parallel.
Related Issues (20)
- karma-parallel do not return exit code 1 anymore on too low code coverage HOT 7
- Exception when using "karma run" HOT 7
- Should fail the test cases split to a browser that is disconnected HOT 4
- No support for Circle CI HOT 2
- Support Karma 4 HOT 1
- When browser disconnects, remaining tests are skipped HOT 5
- Random failures with uncaught errors and missing tests
- Jasmine test timeout is ignored HOT 1
- Random test failures during CI process
- How to enable running tests in parallel on CI
- Publish new version HOT 2
- No calculation of all passed tests on kubernetis -job
- Script Error while executing karma tests HOT 1
- Only supporting Jasmine ?
- Karma parallel cannot find any tests after starting Chrome
- Need help to get code coverage HOT 3
- `Parallel` throws away global beforeEach in multi-browser mode
- Is there a way to let what files to run in what threads/browser instances ?
- failSpecWithNoExpectations to true in jasmine and karma-parallel add the extra tests HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from karma-parallel.