JsUnit
Project Developer Home doxygen

Microsoft Windows Script

JScript in General

Microsoft's JavaScript implementation named JScript is part of the Windows Script. This is a service offered by the Operating System. This contains a generic engine that is able to run a lot of languages, JScript is just one among others. Microsoft offers in the package JScript and VBScript, other vendors offer other languages that can be plugged into the engine. Any application may embed the script engine and process scripts in any of the registered languages.

Please recognize, that products using Windows Script are often delivered with a specific version of the engine. Since it is used as a system wide service, upgrading this engine to a newer version will also upgrade the languages delivered with Windows Script. Therefore even and old Internet Explorer can use an up-to-date JScript version.

The JScript implementation up-to version 5.6 has an incompatible definition of the Error class, they do not provide the Error::name and Error::message members. Early versions also miss the Array::push and Array::pop member functions that are in this case provided by JsUnit.

Windows Script Host

The Windows Script host has two utilities running scripts from command-line: cscript and wscript. Both utilities recognize the file extension and will run JScript files directly. wscript will execute them in a GUI environment, while cscript is a console application running the script in the console.

JScript code can be within normal .js files or the JScript files can be included using a Windows Script Host file (.wsf). JsUnit delivers in the examples AllTests.js and AllTests.wsf for both variants. Such files are also available for the unit tests of JsUnit itself.

Internet Explorer

The Internet Explorer's JScript capabilities are inherited from the installed Windows Script. Therefore even an Internet Explorer 3.x may be able to run JsUnit, if the engine was updated separately. The Internet Explorer adds DOM objects to the JScript. The DOM is different between the various Internet explorer versions, but independent from the JScript version.

Use the HTML include tag to add JsUnit to your scripts. See the file AllTests.html delivered in the examples. Such a file is also available to run the unit tests of JsUnit. You might debug every script using the Windows Script Debugger or more advanced development tools from Microsoft.

General JScript Debugging

Since JScript is embedded into the Windows Script Engine, any debugger capable of debugging this script environment can be used to debug any application using this engine. So it is possible to debug scripts running in the Internet Explorer and in the Windows Script Host as well as scripts running server-side in Active Server Pages.

Windows Script Debugger

The Microsoft Script Debugger is available at MSDN for download. It can be used to debug scripts embedded in HTML documents or for single JavaScript files.

To debug a script from command-line use the command-line interpreters with the /X option:

cscript /X <filename>.js
msscriptdebugger.png

Microsoft Visual InterDev

Microsoft Visual InterDev 6.0 is a development environment for web applications. It is very comfortable with debugging JavaScript code on client- and server side. JsUnit contains a Visual InterDev solution (.sln) and project (.vup) file for the unit tests and the samples. Visual InterDev is now integrated into Visual Studio .NET

interdev.png

JsUnit © 1999, 2000, 2001, 2002, 2003, 2006, 2007 by Jörg Schaible
Generated on Wed Apr 15 2015 02:33:06 for JsUnit by doxygen 1.8.5