cucumber-junit icon indicating copy to clipboard operation
cucumber-junit copied to clipboard

Cannot read property 'length' of undefined

Open antonyhaman opened this issue 7 years ago • 5 comments

Getting this when trying to run ./node_modules/.bin/cucumber-junit > tests/features/cucumber_report.xml

\node_modules\protractor-cucumber-junit\lib\cucumber_junit.js:24
    var lastAssert = stepJson.assertions.length - 1;
                                        ^
Cannot read property 'length' of undefined

What I'm doing wrong?

antonyhaman avatar Nov 01 '16 14:11 antonyhaman

see if you can use ./node_modules/.bin/cucumber-junit-enhance file instead of ./node_modules/.bin/cucumber-junit

jperkns avatar Jan 13 '17 10:01 jperkns

What is cucumber-junit-enhance?

stjohnjohnson avatar Feb 02 '17 18:02 stjohnjohnson

Hit the same error.

noahlz avatar Feb 09 '17 18:02 noahlz

@stjohnjohnson what the poster means is run this instead

./node_modules/.bin/cucumber-junit-enhance > tests/features/cucumber_report.xml

I did this and it worked.

noahlz avatar Feb 09 '17 19:02 noahlz

@stjohnjohnson to elaborate, it looks like the OP and @jperkns, like me, got here via protractor-cucumber-junit, which appears to be a fork of cucumber-junit for protractor support.

noahlz avatar Feb 10 '17 01:02 noahlz