How can I prevent the QUnit Test Harness from hanging when I reference jsUnitMockTimeout.js - qunit

why is it that when I reference the following script -- jsUnitMockTimeout.js
the QUnit test harness just hangs displaying Running...
Thanks

Related

Under MonoTouch.NUnitLite when using Xamarin, "Run All" causes System.Reflection.TargetException

I have created an iOS unit test project.
When I run my [TextFixture]s individually, everything is fine, all my tests pass.
If I choose Run All however, one [TestFixture] will pass but the others will fail with the following error:
System.Reflection.TargetException: Object of type 'MyNamespace.Tests.iOS.Tests.TestBar' doesn't match target type 'MyNamespace.Tests.iOS.Tests.TestFoo'
TearDown : System.Reflection.TargetException : Object of type 'MyNamespace.Tests.iOS.Tests.TestBar' doesn't match target type 'MyNamespace.Tests.iOS.Tests.TestFoo'
It's always in the same pattern too. In the case above MyNamespace.Tests.iOS.TestFoo was run first and then any suite that tries to run next will generate those errors with the associated [TestFixture].
WORKING
If I drill down to one of the [TestFixtures]s that failing in the simulator and run one test, then scroll to Run All for just that suite it's fine.
FAILING
If I get that error and drill down to one of the [TestFixture]s that failing in the simulator, then scroll to Run All for just that suite it fails.
So it seems the act of running one test in a suite must reset something but I don't know what.
It seems similar to this issue:
https://bugzilla.xamarin.com/show_bug.cgi?id=18655
I do have async tests in play.
Here's what it looks like:
... LATER ...
Digging further, I just tried upgrading to NUnit 3.6.1 and The corresponding runner:
https://github.com/nunit/nunit.xamarin
And I don't get the errors, so it seems it's just a bug with the older version of NUnitLite?

PhpStorm: break on errors when running PHPUnit tests

PHPUnit tests are designed to swallow errors and exceptions and just print them to the console which is a correct default behavior. However, if I wanted PhpStorm to break on errors (not failures) in tests, is there a way to configure it that way?
Ideally, I'd like to do:
Turn on the magic switch I'm asking about.
Debug the unit tests.
Watch PhpStorm break when an error occurs.

Swift unit test not stopping after XCTFail() has been called

It was my understanding that if you called XCTFail() in one of your unit tests it will fail that test instantly and not carry on and check the remaining assertions. However, this doesn't seem to be the case, at least not in my current project.
We even tried it on a very simple unit test that was passing. We added the XCTFail() before the assertion which caused the unit test to fail but it still carries on and runs the assertion check after the XCTFail().
Is this just a misunderstanding on my part or is something going wrong here? If it is a misunderstanding, what is best practice to tell your unit test to not bother checking the other assertions as you already know they're going to fail?
It's a Swift unit test by the way using the XCTest framework. I've not given a code example as it seems to be the case on every one of our unit tests, no matter how simple they are.
Xcode Version 7.2.1 (7C1002)
You can set continuesAfterFailure to false. Then the test runner stops when one test fails.

Unit tests always "successful"

I have added a new unit test to my project's test target recently, and when I hit Product > Test, Xcode says, "Test succeeded". I am fairly certain though that the test should fail, because the method under test has not been implemented yet. I added a breakpoint to the test, but it is never being reached; the test is still "successful" without breaking. Growing suspicious, I have added STFail to a different test - still, "Test succeeded".
I am certain that the unit tests did work in the past. Since then I haven't performed any changes to the project structure I am aware of; only that I have updated Xcode to 4.4.
I have found this post explaining how to examine the scheme's test settings, and they look correct to me: the test target is listed under "tests", and it and all of its tests are checked.
What can I do to find the reason for the tests always succeeding?
The issue was caused by a framework I had added to the project that caused an error on execution.
I decided to ignore the unit tests for now and move on to the actual project. When I ran it, it produced an error:
dyld: library not loaded: <Framework name>
Once I saw this, I removed the newly referenced framework, and the unit tests behaved as expected. I then discovered the little buttons to the far right in the test results page that pop open the test's console output. There were the error messages Xcode had hidden all the time, claiming the tests ran successfully.

Handling Assertion failure in automated testing

I am running a automated testing of a application written in VC++ and I run the debug version of the application from the command line but during the testing if assertion is triggered visual studio displays a window with options abort, retry and ignore.The automated testing can not proceed further as it requires user input to continue. Is there a way to overcome this problem. I want to consider the test case as a failure if assertion occurs and continue with the other tests.
ASSERT is likely implemented as a macro. In your testing framework, somewhere before the code-under-test, #define ASSERT(c) TestFrameworkCatchAssert(c, ##c). Then define the TestFrameworkCatchAssert function to test the assertion, and record the result for use in a
"Should-Not-Assert" clause in the test case code.

Resources