import { eq } from 'orbit/lib/eq';
import {
  serializeOps
} from './operations';

function transformMatching({ operations: expectedOps }) {
  return sinon.match(function({ operations: actualOps }) {
    return eq(serializeOps(expectedOps), serializeOps(actualOps));
  });
}

export { transformMatching };

import { eq } from 'orbit/lib/eq';
import TransformBuilder from 'orbit-common/transform/builder';

const transformBuilder = new TransformBuilder();

function transformMatching(transformCallback) {
  const transform = transformBuilder.build(transformCallback);
  const expectedOps = transform.operations;

  return sinon.match(function({ operations: actualOps }) {
    return eq(expectedOps, actualOps);
  });
}

export { transformMatching };

Allow transform builder to be used with 'transformMatching' sinon matcher
Allow transform builder to be used with 'transformMatching' sinon matcher
