Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

testing wrapper methods

 
Wendy Gibbons
Bartender
Posts: 1111
Eclipse IDE Oracle VI Editor
  • 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: 34973
379
Eclipse IDE Java VI Editor
  • 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: 1111
Eclipse IDE Oracle VI Editor
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic