GithubHelp home page GithubHelp logo

Comments (8)

mavdi avatar mavdi commented on July 28, 2024

Hmmm not seen it before, can you provide any more info?

from grunt-cucumberjs.

jdewit avatar jdewit commented on July 28, 2024

I just tried again on a fresh express-seed app and it works as expected. Looks awesome. Sorry for the bother.

from grunt-cucumberjs.

jdewit avatar jdewit commented on July 28, 2024

This error happens if you console.log something in your cucumber step definitions.

I'm wondering if there is a way to tell the difference between report output from cucumberjs & console logging.

If so, we could print out the log in the right spot in the report and not have the test run fail.

from grunt-cucumberjs.

mavdi avatar mavdi commented on July 28, 2024

Cool, let me have a look. Will get back to you.

from grunt-cucumberjs.

mavdi avatar mavdi commented on July 28, 2024

I know why it's happening, just thinking of a decent solution now.

    cucumber.on('close', function (code) {
      var stdout = Buffer.concat(_.last(buffer));
      if(code != 0) {
        grunt.log.error('failed tests, please see the output');
        (config.format === 'html') ? publish(JSON.parse(stdout)) : grunt.log.write(stdout);
        return done(false);
      }

      publish(JSON.parse(stdout));
      return done();
    });

specifically

      publish(JSON.parse(stdout));

Problem is that console statements mix with the stdout of cucumber.js JSON output. Not sure what to do yet... any suggestions?

from grunt-cucumberjs.

jdewit avatar jdewit commented on July 28, 2024

Stripping out the console statements from the stdout does not appear easy. We do know what the json structure should look like so it may be possible with some crazy string parsing.

I haven't looked much into the cucumberjs source but I wonder if the console statements could be handled separately.

from grunt-cucumberjs.

jdewit avatar jdewit commented on July 28, 2024

Turns out it was easy. Cucumberjs outputs the console statements before the json report.

All I had to do was find the point where the cucumber report data starts and split the output.

from grunt-cucumberjs.

mavdi avatar mavdi commented on July 28, 2024

@jdewit just published this now as 0.3.0.

from grunt-cucumberjs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.