Proposed alternative: 

```js
toDataUrl(contact.photo[0], function(dataURI) {
  assert.strictEqual(b64Photo, parseDataUri(dataURI).value);
}
```