Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
MrDoDo
Jun 27, 2004

You better remember quick before we haul your sweet ass down to the precinct.

an skeleton posted:

Got a question. I'm an intern at a local company and one of our goals this month is to get jasmine/karma testing online for one of our company's web applications this month. Problem is, the people who are supposed to help us are always busy and it doesn't seem like its gonna get done unless we do it ourselves. However I have no experience with unit testing and I'm feeling kinda intimidated by the whole idea, does anyone have any guidance for getting a jasmine/karma testing framework online for a large angular/jquery web app?

What do you mean as in "online"? Unit testing is kind of one of those things thats tricky to do after the fact, especially for a large app if it has 0 test coverage. Setting your sights on getting a test suite up, with full coverage for a large JS app in a month is pretty ambitious.

I would just get jasmine/karma running if I were you, even if it is for a sample app at the moment, just to get the hang of it and see how it works. Then pick just a few small sections of the application you know a little bit about and practice writing tests.

Adbot
ADBOT LOVES YOU

MrDoDo
Jun 27, 2004

You better remember quick before we haul your sweet ass down to the precinct.
SQLite?

MrDoDo
Jun 27, 2004

You better remember quick before we haul your sweet ass down to the precinct.

an skeleton posted:

Sooo I'm trying to write jasmine unit tests for our big angular web app (which was not designed with unit testing in mind) and there's something funny happening. We have a checkValue() function that basically checks if a field is blank/invalid and if not, returns that value. The strange thing is, the logic (which was not written by me) seems to be checking for an array. But the <select> directive we are using only makes the value an array if you change it in the view, as far as I can tell. When I'm running jasmine tests I can't seem to replicate this effect (since I am not affecting the value from the view but just manually reassigning values from the unit test), so the tests always crash when the checkValue() function tries to run .join() on the value. Basically I am at a loss of how to make our app think we changed the value from the view and not manually from inside the test, I guess.

Sorry if this makes no sense-- I'm a scrubby intern just learning the ropes with little/no supervision :shrug:

edit: To make matters worse, I'm not sure if the <select> directive is angular native or a custom one written by us

If I were you I would seriously be working on just getting some high level black box testing going. If you have large app like you are describing adding unit tests like this is going to drive you crazy, as you might already be experiencing. Not to completely detract from your original question but I see you continually running in to these types of things on the road that you are on.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply