4

Question:

What is the purpose of the proxy?

In all the documentation, there is not a single direct explanation as to why the proxy is there - yet, it seems to be an essential piece of the intern.js puzzle.

What is it's responsibility, which of the many functional (not functional in a test context) features the proxy is used in and which features it is not used in.

It merely is there spanning across several config params. Any clarification would be greatly appreciated.

On a side note:

intern is a great tool, but the documentation is really lacking. I'd be eager to contribute to improving the documentation, however, I need to be educated first.

freddy mercury
  • 608
  • 1
  • 7
  • 19

1 Answers1

0

The instrumenting proxy is described briefly in the documentation on Running Intern. Its primary purpose is to generate instrumented code at runtime for code coverage analysis. If you are performing functional testing, and your test page uses JavaScript, and you want to get code coverage data, you need the instrumenting proxy.

C Snover
  • 17,908
  • 5
  • 29
  • 39
  • Suppose that I do not want code coverage analysis. Is the proxy then completely negligible? or is that not an option when it comes to intern js? please clarify and thanks in advance. – freddy mercury Feb 28 '14 at 10:43
  • That’s a difficult question to answer because you shouldn’t not want code coverage analysis. There’s not much of a point in writing tests if you aren’t actually sure what parts of your code are being exercised. That said, in theory Intern could be modified to avoid attempting to access its own server, but at the moment it will always do so. – C Snover Feb 28 '14 at 23:09
  • +1 on documenting the proxy. I did not know that the proxy was an integral and mandatory part of intern, this answer should be modified to indicate this as it is currently misleading. Also, [this](https://github.com/theintern/intern/wiki/Using-Intern-to-unit-test-Ajax-calls) page needs to be linked from multiple places, including whenever the proxy is mentioned as it is not only web service calls that are affected (and ajax requests are extremely common, so should be included in tutorial at least) but for serving php test pages etc. – Michael Aug 20 '14 at 07:39