MCPcopy
hub / github.com/strongloop/loopback / assertTargetModelEqualsSourceModel

Function assertTargetModelEqualsSourceModel

test/replication.test.js:1909–1938  ·  view source on GitHub ↗
(conflicts, sourceModel,
    targetModel, done)

Source from the content-addressed store, hash-verified

1907 }
1908
1909 function assertTargetModelEqualsSourceModel(conflicts, sourceModel,
1910 targetModel, done) {
1911 let sourceData, targetData;
1912
1913 assert(conflicts.length === 0);
1914 async.parallel([
1915 function(cb) {
1916 sourceModel.find(function(err, result) {
1917 if (err) return cb(err);
1918
1919 sourceData = result;
1920 cb();
1921 });
1922 },
1923 function(cb) {
1924 targetModel.find(function(err, result) {
1925 if (err) return cb(err);
1926
1927 targetData = result;
1928 cb();
1929 });
1930 },
1931 ], function(err) {
1932 if (err) return done(err);
1933
1934 assert.deepEqual(sourceData, targetData);
1935
1936 done();
1937 });
1938 }
1939});
1940
1941describe('Replication / Change APIs with custom change properties', function() {

Callers 1

Calls 1

doneFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…