Right-click on your web project and select Properties.
Select the Project Facets category.
This is the easiest way to configure your project for JS code quality. If you want to add more details to this configuration, like libraries destination within the project or project references, use the Further configuration available... link that appears in th bottom of the facets table.
Like in any HTML page, the test runners created in RAD have the tests, API's and libraries required by the web browser to run such tests, and as in any HTML page the order where they appear matter. If while running your tests you notice that they're not being executed or some sort of problem at booting them, look at the source code of the HTML and make sure the structure is similar to the following:
The Jasmine-specific files
Your API script files.
Your unit test script files.
The blanket script, if code coverage support is desired.
When configured properly, the scripts order should look like this.
There are different ways to deploy your web projects for testing purposes, but each of them has advantages and disadvantages.
One single web project.
In a single web project you have all your script files: API, test library (a.k.a. Jasmine), and unit test. This is the simplest, so for educational purposes is the best option to choose and as a best practice, keep your files in different folders for an organized layout. The proposed layout is:
- js (folder)
- Your API (folder)
- libs (where the jasmine files are)
- tests (your unit tests)
One more benefit about this pattern is that you don't need to worry for Cross-Origin Resource Sharing problems, as everything is in the same server and context root.
Different projects, same server.
Different projects, different servers.
This is the most complex pattern. Since this pattern involves having two different servers, it means that you will load the remote API scripts (because they're in a different server) into the test application. This is a common pattern in web development called Cross-Origin Resource Sharing (CORS) and you will need to handle it manually in your test scripts to allow CORS calls, otherwise the remote scripts will not be loaded at all.
Go to Window > Preferences.
Expand General > Tracing.
Check the Enable checkbox.
Change the flag to true.
Something to note here, whatever change you do in the debug session will not be reflected in the actual file in RAD. You need to make changes in there too.