function expectEqualError(e1, e2) {
  // message and name are not always enumerable, so manually reference them
  expect(e1.message, 'Async/Sync Error equality: message').to.equal(e2.message);
  expect(e1.name, 'Async/Sync Error equality: name').to.equal(e2.name);

  // compare other enumerable error properties
  for(const propertyName in e1) {
    expect(e1[propertyName], `Async/Sync Error equality: ${propertyName}`).to.deep.equal(e2[propertyName]);
  }
}
Assert that two errors are equal
@param e1 {Error} The first error
@param e2 {Error} The second error