Unit Testing Javascript Code Inlined Within PHP -


at work i've been tasked unit testing our javascript code. settled upon jasmine unit testing framework , began learn how use when informed inline our javascript code within php , not using javascript files longer.

can jasmine work around this? there framework could? should using php unit test , javascript unit test? best approach?

some example code basic page give idea:

http://pastebin.com/k3yp33id

http://pastebin.com/qar8zuh1 <---submit

any sort of insight appreciated

best practice split php out of javascript , unit test each separately. in long run, becomes nightmare maintain , test heavily integrated code. try modularize as possible.

for example, here's how it:

var examplevariables = {     'name' = <?=$name?>,     'occupation' = <?=$occupation?> };  unittestablefunction(examplevariables); 

Comments

Popular posts from this blog

jquery - Invalid Assignment Left-Hand Side -

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -