Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions test/remote-connector.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,24 @@ describe('RemoteConnector', function() {
done();
});
},

// We are defining the model attached to the remote connector datasource,
// therefore change tracking must be disabled, only the remote API for
// replication should be present
trackChanges: false,
enableRemoteReplication: true,

onDefine: function(Model) {
var RemoteModel = Model.extend('Remote' + Model.modelName, {},
{ plural: Model.pluralModelName });
RemoteModel.attachTo(loopback.createDataSource({
var ServerModel = Model.extend('Server' + Model.modelName, {}, {
plural: Model.pluralModelName,
// This is the model running on the server & attached to a real
// datasource, that's the place where to keep track of changes
trackChanges: true,
});
ServerModel.attachTo(loopback.createDataSource({
connector: loopback.Memory,
}));
remoteApp.model(RemoteModel);
remoteApp.model(ServerModel);
},
});

Expand Down
3 changes: 2 additions & 1 deletion test/util/model-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ module.exports = function defineModelTestsWithDataSource(options) {
'domain': String,
'email': String,
}, {
trackChanges: true,
trackChanges: options.trackChanges !== false,
enableRemoteReplication: options.enableRemoteReplication,
});

User.attachTo(dataSource);
Expand Down