New context (or page refresh) for every test execution

582 views
Skip to first unread message

Luca Abbati

unread,
Oct 17, 2014, 5:20:15 AM10/17/14
to karma...@googlegroups.com
Hi,

Assume I have this file configuration:

tests
    |--- test1.test.js
    |--- test2.test.js
my.config.js


I would like to run test1.test.js and test2.test.js separately, each one in a new process/page or with a "page refresh" between their executions.

Is it that possible with Karma (using Jasmine) runner?

Thanks! Luca

Vojta Jína

unread,
Oct 27, 2014, 8:29:57 AM10/27/14
to karma...@googlegroups.com
Nope, Karma refreshes the entire window (iframe) for each test suite run but not for individual tests. This would be slow and so we decided to not support it.

Why do you need it?

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/karma-users/13ed0446-e952-4aac-b411-91b210ce412a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Luca Abbati

unread,
Oct 27, 2014, 8:52:37 AM10/27/14
to karma...@googlegroups.com
Hi thanks for the reply. We are using karma to unit test a ExtJS application, that uses a lot the global scope. Would have been useful to have a clean environment for every run. We will try to organize test in a consistent way grouping them in suites.

Thanks! Luca

ahfa...@gmail.com

unread,
Jul 3, 2015, 11:40:07 AM7/3/15
to karma...@googlegroups.com
I am writing tests for code that uses MutationObservers. If one of my tests fails to disconnect all of it's observers, it can cause my other tests to fail. I would be fine with the slowness for this particular test suite, at least during development while I'm trying to determine which test is failing and why. Would actually be really useful for me to have a 'this.refreshOnEachTest(true)' feature.

mantas....@gmail.com

unread,
Jun 27, 2016, 1:36:20 PM6/27/16
to karma-users
I too have problem of global context state when testing ExtJS. Any update on this?
Reply all
Reply to author
Forward
0 new messages