This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

testing wrapper methods

 
Wendy Gibbons
Bartender
Posts: 1107
Eclipse IDE Oracle VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
my new company have started doing TDD on the new javascript webstuff.
I have written a javascript method:


I can't test it calls the service, as that is an integration test (fully understand)
so what can I actually test?
my mentor wants me to test the parameters are passed in correctly, but these are just constructed in the test.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 33694
316
Eclipse IDE Java VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you let the url for the AJAX submission be a fake one? In particular, just a simple one that always returns success or failure so you can test the function logs the right data?
 
Wendy Gibbons
Bartender
Posts: 1107
Eclipse IDE Oracle VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
a friend (yes my out of work conversations are THAT DULL) suggested i stub the ajax and test the path is correct so that if anyone changes the path in the method it isn't happy.
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic