Comments (5)
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.
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.
You can use nodemon
for that.
from vow.
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.
Yeah, but in that case we need to handle couple of things.
- Do not re-run migrations hooked into
runner.before
andrunner.after
- 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)
- grep option is a misnomer HOT 1
- Is the destructured `test` imported the same as `japa`? HOT 1
- Test file upload HOT 1
- Error: Cannot find module 'Session/Client' HOT 4
- Asynchronous trait HOT 1
- Using DatabaseTransactions does not play well with app transactions HOT 10
- Test/ApiClient send is not processing data the same way server does HOT 2
- When writing tests, how can I get data in session ? HOT 2
- list of directories to run tests from in config file HOT 2
- Testing Websockets
- Adding custom reporter HOT 5
- Response Assert Json Structure HOT 3
- adonis make:test fails and hangs HOT 4
- When writing test how can i make the adonis test command test only a specific file instead of all files in the folder HOT 1
- Test methods not chainable
- Tests does not call authorize inside validators
- Fix order of test files
- Ability to set hook timeouts HOT 2
- list of directories to run tests from in config file HOT 1
- Adonis session not persisting between tests HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vow.