Headless Jasmine unit test with PhantomJs

Just adding a quick not to my previous rant about running jasmine test with ReSharper test runner. Because the fact is that there was still one thing that bugged me about the setup:

Every time I run the unit test, it would open a new tab in my browser to execute the test. Feeling that there should be a way to change that I browsed around in ReSharper options today and found this:

There is was, the option to run tests with PhantomJs

PhantomJs is basically a headless WebKit  browser, that implements a Javascript API. Running javascript unit tests feels just like running a normal nUnit suit. Sweet!

Access Internals from different assemblies

It is always good to reflect what access modifier that should be used when and where. In my current hobby project I found myself exposing really dangerous methods, like


Why? Well, I wanted to test this method, and the unit test of course lays in a different assembly.

May I remind everyone, that it is not necessary! What you want to do is use the InternalsVisibleTo attribute.

In the AssemblyInfo.cs for project that has methods you want to test, just add something like this:

[assembly: InternalsVisibleTo("MyApplication.Core.Tests")]

Thank you a lot for that, Microsoft!