Giter Club home page Giter Club logo

Comments (8)

clouless avatar clouless commented on May 18, 2024 2

I really love this tool. But since you seem to go for a big refactoring maybe these features could be nice too (at least I would love them for our customers projects):

  • Custom Theming (provide logo and colors)
  • Disable test-code being included into json (since for closed-source projects we just want to publish test results and not the code)
  • Since you use react wouldn't it be cool to render the HTML dynamically by loading the JSON in the browser and JSON.parse and then render the HTML (React). That way I could only deploy the json somewhere an have an index.html already there with the JS that renders the report.

As far as I understand you are saying with your new project mochawesome-report one will be able to only generate the json (and not all the assets)? (that would be really nice)

from mochawesome.

adamgruber avatar adamgruber commented on May 18, 2024 2

@clouless Thanks for the suggestions.

Custom theming is an interesting one but probably not something that will make it into the first releases of v2.

I like the option to disable test code but I'm not sure about leaving it out of the json or just making so it doesn't render in the report.

My thinking is that mochawesome will continue to generate the json output and mochawesome-report will consume it and produce the html. This way you should be able to generate a report from previously saved json without re-running the tests.

from mochawesome.

clouless avatar clouless commented on May 18, 2024

sounds great :)

from mochawesome.

ScottFreeCode avatar ScottFreeCode commented on May 18, 2024

Given that Mocha already has a JSON reporter (and a TAP reporter), is there a definite need for Mochawesome to output its own JSON format instead of piggy-backing on an existing one?

For that matter, if you could not only piggyback on the existing JSON reporter output but create a general tool to take JSON reporter output and any Mocha reporter and feed the Mocha reporter the same events Mocha would have to generate that JSON output, not only would Mochawesome then be able to report on saved test result data, but any Mocha reporter would be able to.

(We had somebody ask about converting JSON to other report formats recently due to a situation where the tool that used Mocha limited its output to JSON, and frankly being able to do this would make testing reporters way easier since it could be separated from running tests to generate the results.)

(Although, maybe an even better alternative would be to create a serialization format for the common test reporter interface so not only would the system work for all Mocha reporters but for all test runners too?)

from mochawesome.

adamgruber avatar adamgruber commented on May 18, 2024

@ScottFreeCode I based the JSON output on the built-in JSON reporter but quickly realized that in order to do all the things I wanted Mochawesome to do, I needed to augment the JSON to add properties and relationships that were not in the existing JSON output.

from mochawesome.

ScottFreeCode avatar ScottFreeCode commented on May 18, 2024

Interesting -- so the JSON reporter is lossy compared to what Mocha's reporter events originally provide? (I'm not very familiar with the events myself beyond the concept and the fact that there have been efforts to standardize them.)

from mochawesome.

adamgruber avatar adamgruber commented on May 18, 2024

The JSON reporter is more selective and basic in the data it outputs. I'm sure it has its uses but it wasn't created to be used as the basis for rendering a full-fledged HTML report.

from mochawesome.

adamgruber avatar adamgruber commented on May 18, 2024

Version 2 is out now

from mochawesome.

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.