Adds Jasmine tests for Factory pattern