Testing Javascript before loading into APIGEE

If we want to load java file in javacallout policy,I can test independently through eclipse.

Is there any method or tool to test javascript policy before we load into apigee?When my javascript code contains many lines,I feel painful job to deploy everytime to do the javascript verification.

This may be beginner level question.Kindly help me.

0 3 714
3 REPLIES 3

Not applicable

Hi @Subbu R , there are certainly techniques in JavaScript for unit testing your code. So before deploying code in Edge, you can unit test functions and catch exceptions. Check this insightful article about unit testing with Mocha, Sinon, and Expect.js written by my colleague @oseymen@apigee.com.

I will also encourage you to incorporate unit tests as part of your Continuous Integration (CI) cycle. Apigee Grunt Plugin can do this for you.

Upvote. Totally agree. If your not writing JavaScript unit tests using something like Mocha, Jasmine, Tape or The Intern your likely gong to spend some hours debugging your JavaScript within Edge which is NOT very fun now is it?

adas
New Member

@Subbu R Here's something that was built by one of our apigeeks and open sourced. Take a look: https://github.com/r8k/sparrow.js/blob/master/README.md

This was built specifically for the purpose of being able to test javascripts before running them on Apigee.