0

I have a project with 2 functional Suites, the structure is like this:

- /tests
--- /sign
------ sign.js
--- /buy
------ buy.js
--- intern.js
- /node_modules
- ....

On my intern.js I have this

//...
functionalSuites: [ 'tests/sign/sign', 'tests/buy/buy'],  
//...

And to run the test intern-runner config=tests/intern

So far so good, 2/2 tests passed.

I would like to know if it's possible to pass some arguments to execute only a part of the functionalSuites

ex:

intern-runner config=tests/intern --sign

And somehow it would run only the functionalSuite tests/sign/sign

And if I pass intern-runner config=tests/intern --all it would run all functionalSuite tests.

Thank you

2 Answers 2

1

You should use the grep parameter introduced in Intern 2.1 release announce. With grep you can target one specific test or a class of tests depending on your naming convention.

In our case, the functionSuites settings contains only 'test/functional/**/* to be sure that no functional test is forgotten by the CI process. And we use the grep attribute during the script development.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks. I'll take a look!
1

The simple solution is: intern-runner config=tests/intern functionalSuites=test/sign/sign

The more complicated (but good for long term) is to write a filter function by yourself (hmm, maybe you can make a request to https://github.com/theintern/intern?). We do have our custom filter, but it's too complicated to write down here. If you make a request to Intern, maybe I will try to spend sometime to make a pullrequest for it (or maybe someone else) Anyway the result I get is:

(I have 2 files named file1_func.js, file2_func.js and some more files) enter image description here

2 Comments

I didn't know about that parameters. Thanks. I'll take a look
-f is my custom filter, you will not find it in Intern. But I guess you can try with functionalSuites

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.