@rwldrn is pointing out the behavior of the "real" `MessageManager.send` method: it accepts a "success" callback and a "failure" callback. The latter is called in response to failure (and with the number). So it looks like I should re-factor in this way:

```diff
-  MessageManager.send = function(number, text, callback) {
+  MessageManager.send = function(number, text, success, failure) {
    var sent = {
      type: 'sent',
      message: {
        sender: null,
        receiver: number,
        delivery: 'sending',
        body: text,
        id: messagesHack.length,
        timestamp: new Date()
      }
    };

    var simulateFail = /fail/i.test(text);

    MessageManager.onMessageSending(sent);
    window.setTimeout(function() {
      if (simulateFail) {
        // simulate failure
        MessageManager.onMessageFailed(sent);
-       if (typeof callback === "function") {
-         callback(null);
+       if (typeof failure === "function") {
+         failure(number);
        }
        return;
      }

      // simulate success
      sent.message.delivery = 'sent';
      MessageManager.onMessageSent(sent);

-     if (typeof callback === "function") {
-       callback(sent.message);
+     if (typeof success === "function") {
+       success(sent.message);
      }
```

Does that look right to you?