test: load the correct Remote instance

Fix unit-tests to always reference the remote connector via
require('..') instead of depending on the remote connector
bundled in loopback, which is quite often an older version.
This commit is contained in:
Miroslav Bajtoš 2015-11-24 18:25:48 +01:00
parent 9fce179932
commit 9d862437da
1 changed files with 3 additions and 2 deletions

View File

@ -1,6 +1,7 @@
var loopback = require('loopback'); var loopback = require('loopback');
var defineModelTestsWithDataSource = require('./util/model-tests'); var defineModelTestsWithDataSource = require('./util/model-tests');
var assert = require('assert'); var assert = require('assert');
var Remote = require('..');
describe('RemoteConnector', function() { describe('RemoteConnector', function() {
var remoteApp; var remoteApp;
@ -15,7 +16,7 @@ describe('RemoteConnector', function() {
test.dataSource = loopback.createDataSource({ test.dataSource = loopback.createDataSource({
host: '127.0.0.1', host: '127.0.0.1',
port: remoteApp.get('port'), port: remoteApp.get('port'),
connector: loopback.Remote connector: Remote
}); });
done(); done();
}); });
@ -42,7 +43,7 @@ describe('RemoteConnector', function() {
test.remote = loopback.createDataSource({ test.remote = loopback.createDataSource({
host: '127.0.0.1', host: '127.0.0.1',
port: remoteApp.get('port'), port: remoteApp.get('port'),
connector: loopback.Remote connector: Remote
}); });
done(); done();
}); });