Scott
Scott

Reputation: 117

How to make XHR requests in functional intern tests

I have an app that I have developed using localhost. It makes relative xhr requests like this

http://localhost/arcgis/rest/...

When I try to run the app from within a functional test using intern, it loads my app on port 9000 (http://localhost:9000/...). This is causing all of my xhr requests to fail because they are now cross-domain.

I could probably make it work using jsonp or CORS, but I'm wondering if intern has already solved this problem. It would be great if it had a proxy that made the requests using a configurable base url or something. Is this functionality available?

Upvotes: 1

Views: 203

Answers (1)

Scott
Scott

Reputation: 117

It's all spelled out in the new wiki page: Using Intern to unit test Ajax calls.

Thanks, Colin!

Upvotes: 1

Related Questions