Git Product home page Git Product logo

Comments (5)

ekkis avatar ekkis commented on July 24, 2024

so if I can declare in my Gruntfile.js:

simplemocha: {
    all: { src: 'test/*-node.js' }
}

why would I need grep?

from grunt-simple-mocha.

ts-web avatar ts-web commented on July 24, 2024

@ekkis, the grep option does not filter files, but rather the tests themselves. It's a Mocha option. See Mocha's CLI options:

-g, --grep <pattern>                    only run tests matching <pattern>

It says "tests", which apparently means the description string of the describe() blocks.
Mocha will search for the grep pattern in the test description, and only run those tests that match.

from grunt-simple-mocha.

ts-web avatar ts-web commented on July 24, 2024

This repository should really remove the grep option from the examples. It will only confuse people and cause their setups to not run any tests! Because who writes describe() blocks containing the string -test in the test description?

Since the grep will match none of their describe blocks, then none of their tests will run. So grep should be removed from the examples.

from grunt-simple-mocha.

ekkis avatar ekkis commented on July 24, 2024

ah. that explains why I get 0 passing (0ms). LoL. thanks guys

from grunt-simple-mocha.

yaymukund avatar yaymukund commented on July 24, 2024

You're right— this is pretty confusing! Thank you for opening the issue and I'm sorry for the confusion. I've clarified in the docs that it merely passes the options to new Mocha

from grunt-simple-mocha.

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.