Want to run client side QUnit tests from Visual Studio or your build server? Now it is easier than ever; just grab newly updated XUnit.PhantomQ v1.2 from NuGet!
XUnit.PhantomQ will allow you to execute your QUnit tests as XUnit tests. It supports both library and web projects, and features the ability to easily specify test files and their dependencies by real relative path from the root of your project.
XUnit.PhantomQ on NuGet
XUnit.PhantomQ Source on GitHub
Change Log for v1.2
My thanks to James M Greene and the other authors of the PhantomJS Runner; their work served as the model for this version's improved test result information.
- Significantly improved test result information and error details.
- Added console.log support.
- Added test timeout configuration support.
- Added QUnit module support.
- Added QUnit result details to QUnitTest.Context
Example Code
// Contents of Demo.js
function getFive() {
return 5;
}
// Contents of Tests.js
test('Test Five', function() {
var actual = getFive();
equal(actual, 5);
});
test('Test Not Four', function () {
var actual = getFive();
notEqual(actual, 4);
});
// Contents of QUnitTests.cs
public class QUnitTests
{
[Theory, QUnitData("Tests.js", "Demo.js")]
public void ReturnFiveTests(QUnitTest test)
{
test.AssertSuccess();
}
}
Enjoy,
Tom
No comments:
Post a Comment