Skip to content

Latest commit

 

History

History

UnitTests

README.md

Control unit tests

This project is an example to create unit tests for a framework control. The tests are working on the ColorChange control in the ExampleControls Visual Studio project.

Preparation

All needed software is delivered via NPM packages. To download and install these you need to call once

npm install

in the same directory as the package.json file.

Until then, the Visual Studio build of this project fails, because the TypeScript type definitions of Jasmine ("types": ["jasmine"] in tsconfig.json) are missing (error TS2688: Cannot find type definition file for 'jasmine').

Running tests in local browser

After that you need to start the test webserver by running the following command:

npx jasmine-browser-runner serve

startTest.bat runs the same command.

This produces an output which shows an url like this:

Jasmine server is running here: http://localhost:8888

This is the url you need to open with your chrome or firefox.

Explanation of infrastructure

The framework control project itself has the code under test: