function expectImageEquals(image, expected) {
  expect(image).to.be.a(Image);

  const expectedScale = expected.getScale();
  expect(image.getScale()).to.eql(expectedScale);

  if (expected instanceof Icon) {
    if (!(image instanceof Icon)) {
      throw new Error('Expected image to be an Icon');
    }
    const expectedSrc = expected.getSrc();
    expect(image.getSrc()).to.eql(expectedSrc);
    return;
  }

  throw new Error(
    `Comparison not implemented for ${expected.constructor.name}`,
  );
}
@param {Image} image The image symbolizer to test.
@param {Image} expected The expected image symbolizer.