简体   繁体   中英

How to run a unique test in Adonis.js

I have a problem here. I need to test just the 'montagem-ambiente' without run 'usuario', but, when a run adonis test he will run all the test in the folder.

I already try adonis test -f 'filename' and adonis test group 'filename' and the path file, but i could not understand how these commands works.

seeing the adonis test -h i cannot understand how to solve my problem

In adonis docs, i dont find the answer

Test images

In Adonis forum i see a topic with a same problem, but i cannot understand how to apply in my case

Some superhero over here can help me?

I found the answer... Well... It's embarrassing but it can help someone who is just starting out like me...

Its just

adonis test --files test/unit/montagem-ambiente.spec.js or adonis test -f test/unit/<name>

I hope to help anyone!

You can try to run tests via node ace test command.

Eg node ace test -g "test my first test" for use grep by test case name or node ace tets -f "my_test.js" for run a particular test class.

Please note that you need to have unique test cases names to be able to run one test using -g flag.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM