Giter Site home page Giter Site logo

--watch option about vow HOT 5 OPEN

adonisjs avatar adonisjs commented on May 19, 2024 7
--watch option

from vow.

Comments (5)

sr2ds avatar sr2ds commented on May 19, 2024 2

Is there any way to watch for spec changes and re-run the tests automatically instead of running the command every time manually?

Hello @ignatevdev

Perhaps this can help you, a simple implementation with onchange, unfortunately requires the installation of the package but, if it is just a development dependency, I believe that it is still viable.

Install the onchange package:

 npm i onchange --save-dev

Create the script line in your package.json:

"scripts": {
    ....
    "test:watch": "onchange 'app/**/*.js' 'test/**/*.js' -- node ace test"`
    ....
}

Run npm run test:watch and finish.

Although the topic is old, it can help someone.

Programming with tests in real time is really great!

from vow.

loweoj avatar loweoj commented on May 19, 2024 1

Could you show us how we could use nodemon? I'm not sure which command to execute with nodemon - nodemon adonis test doesn't work. (Sorry, I'm very new to Adonis/Node!)

EDIT: Found the option I was looking for -x
nodemon -x adonis test

from vow.

moltar avatar moltar commented on May 19, 2024

You can use nodemon for that.

from vow.

alex996 avatar alex996 commented on May 19, 2024

nodemon is only included with @adonisjs/cli, so it'd be nice to add a new Ace command there. adonis test:watch' or adonis test -w would make sense.

from vow.

thetutlage avatar thetutlage commented on May 19, 2024

Yeah, but in that case we need to handle couple of things.

  1. Do not re-run migrations hooked into runner.before and runner.after
  2. Only re-run the test you are editing (I believe, that's how Karma watcher does it)

Feel free to share any more insights you have

from vow.

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.