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

Function assertChangeRecordedForId

test/replication.test.js:1208–1227  ·  view source on GitHub ↗
(id, cb)

Source from the content-addressed store, hash-verified

1206 }
1207
1208 function assertChangeRecordedForId(id, cb) {
1209 SourceModel.getChangeModel().getCheckpointModel()
1210 .current(function(err, cp) {
1211 if (err) return cb(err);
1212
1213 SourceModel.changes(cp - 1, {}, function(err, pendingChanges) {
1214 if (err) return cb(err);
1215
1216 expect(pendingChanges, 'list of changes').to.have.length(1);
1217 const change = pendingChanges[0].toObject();
1218 expect(change).to.have.property('checkpoint', cp); // sanity check
1219 expect(change).to.have.property('modelName', SourceModel.modelName);
1220 // NOTE(bajtos) Change.modelId is always String
1221 // regardless of the type of the changed model's id property
1222 expect(change).to.have.property('modelId', '' + id);
1223
1224 cb();
1225 });
1226 });
1227 }
1228 });
1229
1230 describe('complex setup', function() {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…