I am writing an application for Windows 8 and writing block tests for it. How can I run them automatically in a Windows 8 environment?
If I write super-simple JavaScript files, regardless of the Windows 8 or DOM environment, I can unit test them from the command line using Node.js. It is very fast (less than one second).
If I need to enable the DOM, and I use the DOM for not too new functions, I can use jsdom in Node.js and get the same setup and at the same speed.
But jsdom is incomplete, and often I want to use basic Windows 8 features such as the WinJS core library (like WinJS.Promise ) or Windows.* enumerations Windows.* . And ideally, I should test in the same JS engine and in the DOM environment, since my application will really work.
Ideally, I need a test runner: a lightweight container for Windows 8 HTML5 that can run some unit tests with a real DOM and access to the WinJS and Windows Runtime APIs. To integrate into the build process, I also need the ability to report the results back to the command line (stdout, stderr) and change the test runnerโs return code depending on success or failure. And it must be fully automated, possible in the background and very fast (less than 10 seconds).
I know that for WebKit there are tools such as, for example, PhantomJS . Is there such a situation for the Windows Runtime HTML5 environment? If not, which APIs should I look for to create something like this?
Domenic
source share