       e.which = 100 # 'd'
       $expiry.trigger(e)
 
-      assert.equal $expiry.val(), '1'
+      setTimeout ->
+        assert.equal $expiry.val(), '1'
+        done()

      e.which = 47 # '/'
      $expiry.trigger(e)

      assert.equal $expiry.val(), '01 / '

    it 'should only allow numbers', ->
      $expiry = $('<input type=text>').payment('formatCardExpiry')
      $expiry.val('1')


      assert.equal($.payment.cardType('6216657720782466507'), 'unionpay')

  describe 'formatCardNumber', ->
    it 'should format cc number correctly', (done) ->
      $number = $('<input type=text>').payment('formatCardNumber')
      $number.val('4242')

