Anyway to get my Jasmine tests to run against the local gae server

274 Views Asked by At

I'm trying to test my backbone front-end using Jasmine against our back-end API.

Our application is built on google app engine, and our build system uses maven, so I'm using the jasmine-maven-plugin to facilitate testing the front-end integration with the API.

But, when I try to run the tests, none of the REST API calls are available (which makes sense since the server jasmine spins up is solely for jasmine testing).

Does any one know of a way to get the Jasmine plug in to use the jetty server that the "gae:run" target spins up?

Because there's a ton of authenticated calls, the server that is doing the front-end testing and the API need to be the same, including port (or it would be all cross-domain requests).

1

There are 1 best solutions below

0
On BEST ANSWER

Looking at the Jasmine source code for the server here: https://github.com/searls/jasmine-maven-plugin/blob/master/src/main/java/com/github/searls/jasmine/ServerMojo.java it looks like jasmine is explicitly using the jetty server directly. I don't believe that appengine gives you access to its custom jetty driver directly but you might want to look at the gae-maven-plugin source to see how they do it. You would need to write your own implementation of the ServerMojo for jasmine and plug it in there though.