using multiple test frameworks simultaneously

735 views
Skip to first unread message

marco

unread,
Sep 24, 2013, 10:10:48 AM9/24/13
to karma...@googlegroups.com
Hi, is it possible to use two or more test frameworks and have karma run the tests for all of them?

Specifically I want to run QUnit and Jasmine tests. I have the following in my config:
   ...
   frameworks: ['jasmine', 'qunit'],
   ...


Unfortunately, Karma runs only the Jasmine tests. If I change the order of the 2 frameworks in the config, Karma only runs the QUnit tests.

Thanks,
marco

Vojta Jína

unread,
Sep 26, 2013, 4:51:30 AM9/26/13
to karma...@googlegroups.com
Currently it is not - these adapters are not designed to work together.

In theory it is possible - Karma needs to support multiple "start" methods. That's simple, the __karma__.start can be an array rather than a function.
Then, it has to "merge" multiple calls to complete.


Why do you need this ? Isn't having two configs - separate Karma projects sufficient ? (eg. karma-jasmine.conf.js and karma-qunit.conf.js)

V.


--
You received this message because you are subscribed to the Google Groups "karma-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to karma-users...@googlegroups.com.
To post to this group, send email to karma...@googlegroups.com.
Visit this group at http://groups.google.com/group/karma-users.
For more options, visit https://groups.google.com/groups/opt_out.

marco

unread,
Oct 1, 2013, 5:39:06 AM10/1/13
to karma...@googlegroups.com
Thanks for your answer!

I need this in a bigger project where I'm about to setup karma as javascript unit testing framework. There are already a couple of jasmine tests as well as qunit tests. My goal was to create a new Jenkins build job that continuously runs all the js unit tests and provides an aggregated view of the test results. Since the karma configuration allows for multiple frameworks to be specified, I assumed that this was possible. Why does the "frameworks" configuration section accept an array? Are there any efforts to support multiple frameworks in a single karma configuration in the near future? I would really like to see that :-)

I guess until then, I'll go for two separate configurations - and unfortunately two separate Jenkins jobs.
marco

Vojta Jína

unread,
Oct 6, 2013, 7:05:08 PM10/6/13
to karma...@googlegroups.com
It's an array, because there are other "frameworks" that people can use (not just testing frameworks), for instance "requirejs", so one can do:
frameworks: ['jasmine', 'requirejs']

I'm not against supporting multiple testing frameworks at the same time, but it's not a high priority for me.

You can have two Karma projects (configs), but run them both as a single Jenkins job.

You might also try something similar to https://github.com/vojtajina/karma-jstd and step by step migrate to Jasmine...

V.
Reply all
Reply to author
Forward
0 new messages