Jacob Maine's blog



Jacob MaineJacob Maine
Standup 2012/2/1: Speed kills
edit Posted by Jacob Maine on Wednesday February 01, 2012 at 10:17AM

Interesting Things

  • If you haven't noticed, Jasmine tests are at least twice as fast in Chrome as they are in Firefox. Closing the inspection pane makes it even faster. Be aware that part of the speed is from Chrome's aggressive caching, which can lead to erroneous test results.
  • One team is using Backbone's local storage. When they add model.clear() after every test run, their tests go from 20 seconds to over 100 seconds. Someone suggested the silent: true option, to suppress the change events that clear triggers.
  • To avoid bugs in minified JS put semicolons in the right spots. The easiest way to do that is to run a tool like JSLint or JSHint over your code. Add it to your test suite to prevent mistakes.

Ask for Help

  • "In IE8 the numbers don't show up on ordered lists if we dynamically create lis"

Or rather, they do, but only after hovering over the list. The common wisdom is that this has been broken in IE for a long time.

  • "Our project does some DNS resolution. Is there a preferred way to mock this in tests?"

No suggestions.

  • "When replying to an email each email system adds different junk to the message. We're processing those incoming replies. Any standard way to strip out the junk?"

Everyone is using the ugly regex approach. Are there mail gems that handle this?