简体   繁体   中英

How to run specific tests with frisby?

We are using frisby to run our integration tests and while developing them, it would be handy to execute one specific one or a group of tests, without having run all of them and see extra noise. Right now I am commenting out all the ones I don't want to run, which is getting tedious.

Is there a way, from the command line, to run specific frisby tests?

So basically, instead of

npm test

I want to be able to say

npm test --name: posts

Or something like that. I found this post about jasmine-only, but I'm not sure it will satisfy my needs.

Thanks so much!

I'm not sure if you're still looking for answer, but this is pretty simple.

Firstly install latest version of jasmine-node from command line: npm install jasmine-node -g

Then to run particular test use: jasmine-node --coffee putTestNameHere

Install jasmine-node module. Execute one file at a time - you can group your test cases in specific file:

jasmin-node moduleTestCases_spec.js

Also, if you want to specify exact test case name to be executed, you can make use of sequenty module. It is a nodejs module, which you can specify the order(and thus the exact test cases to execute).

To run specific test in Frishby just run:

npm test ./folder/filename.js

So lets assume you have an folder say test under that you have a file called api.spec.js then you will execute like this:

npm test ./test/api.spec.js

Parallely don't forget to specify these below things into your package.json file

"scripts": {
    "test": "mocha"  }

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