Open nathany opened 9 years ago
Of course we also need to get a better feel for how errors from Apple occur in real life (readErrors). Using a production device token with a sandbox cert setup should do the trick.
Validations before sending data should be able to prevent a good number of these.
Still, there are errors that can occur at any time.
I think I'd prefer having a connection that satisfies the interface, but is initialized with a specific status code to return. Seems more explicit.
True.
We should be able to use validations to avoid errors 2-8. I would like to separate out the preparation of the data to send Apple from the actual sending.
I'd like some tests for errors from Apple but without actually hitting Apple's servers in the test suite.
I'm thinking about mockConn having a special device token that results in 8 Invalid token, or that sort of thing. A bit like test credit cards.My thought is to only do this for tests within the apns package, not impacting the callers of this library in any way.