Code Monkey home page Code Monkey logo

elm-coverage's Introduction

Elm Coverage Build Status Build status Documentation Status

Work in progress - Code coverage tooling for Elm

elm-coverage is a tool for calculating code coverage for Elm code tested with elm-test.

The goal of the reports generated by elm-coverage is to help you visualize what parts of your code are being evaluated when running your tests, and to try and guide you towards writing tests that focus specifically on the more complex functions in your codebase.

The goal is not to condense that information down into a single metric. It is too easy to write tests that don't make meaningful assertions about your code and its behaviour, but only serve to increase the coverage.

The only thing worse than having no tests is having tests that provide a false sense of security.

For further reading, please direct yourself to https://elm-coverage.readthedocs.io

Installation

Installing elm-coverage works much the same way as installing other tools in the Elm ecosystem:

npm i -g elm-coverage

Usage

The simplest invocation of elm-coverage is to simply invoke elm-coverage in the root of your project:

elm-coverage

By default, elm-coverage assumes that your sources exist in a separate src/ directory, that you have elm-test installed globally, and that elm-test needs no further, special flags.

You can specify an alternative path to crawl for sources to instrument:

elm-coverage elm_src/

If you don't want to use a globally installed elm-test, you can specify the path to an elm-test executable:

elm-coverage --elm-test ./node_modules/.bin/elm-test

Parameters following -- are passed through to elm-test, for example to specify the initial seed and number of fuzz testruns:

elm-coverage -- --seed 12345 --fuzz 99

elm-coverage will write an HTML report to .coverage/coverage.html. It is not recommended to version control this directory. In order to open the report once it is generated, you can specify the --open option:

elm-coverage --open

Contribute

Issues and source code is available on github. The source for elm-instrument which is used to actually instrument the sources in order to calculate coverage is also available.

License

elm-coverage is licensed under the BSD-3 license. elm-instrument is licensed under the BSD-3 license.

elm-coverage's People

Contributors

zwilias avatar

Watchers

 avatar

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.