Make sure frisby and jasmine using the same url

165 Views Asked by At

I have an angularjs application with a .NET web api as a backend.

I'm using jasmine to test my angular app, xUnit for the .NET backend and Frisby to make sure the web api responds the way I expect it to be.

It all works fine except one particular thing: When I change an URL of my Web API my Frisby tests fail as expected but -of course- my jasmine tests are still working. This is because my angular tests don't really call the web api and therefore don't see the changes. This is bad because when I change the web API url I would also have to change the url from the caller (in agnularjs), but without failing tests I don't see that something has to be changed in my angularjs app, so I could miss that and would notice the outdated url not until I test it manually.

My first thought how to make it all work is to share the url for the tests (jasmine and frisby) in a common file. So the workflow would look like this:

  1. I notice a badly named url
  2. I change the url in the common test file
  3. both, the frisby and jasmine test fail
  4. I change the url in the web api --> my frisby test turns green, my jasmine test still fails
  5. I change the url in my angular app --> my jasmine test turns green as well

Is this the right approach and if so how can I include this common url-file into my frisby and jasmine tests. If not, how would you do it?

0

There are 0 best solutions below