fixup!: update test file
This commit is contained in:
parent
2316300b9a
commit
c07f169ca1
|
@ -5,7 +5,6 @@
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const semver = require('semver');
|
|
||||||
const should = require('should');
|
const should = require('should');
|
||||||
const juggler = require('loopback-datasource-juggler');
|
const juggler = require('loopback-datasource-juggler');
|
||||||
const name = require('./package.json').name;
|
const name = require('./package.json').name;
|
||||||
|
@ -28,22 +27,6 @@ describe(name, function() {
|
||||||
// === Operation hooks ==== //
|
// === Operation hooks ==== //
|
||||||
|
|
||||||
const suite = require('loopback-datasource-juggler/test/persistence-hooks.suite.js');
|
const suite = require('loopback-datasource-juggler/test/persistence-hooks.suite.js');
|
||||||
|
const customConfig = Object.assign({}, global.config);
|
||||||
const DB_VERSION = process.env.MONGODB_VERSION;
|
suite(global.getDataSource(customConfig, juggler.DataSource), should, {replaceOrCreateReportsNewInstance: false});
|
||||||
|
|
||||||
if (!DB_VERSION) {
|
|
||||||
console.log('The ENV variable MONGODB_VERSION is not set.' +
|
|
||||||
' Assuming MongoDB version 2.6 or newer.');
|
|
||||||
}
|
|
||||||
|
|
||||||
const DB_HAS_2_6_FEATURES = (!DB_VERSION ||
|
|
||||||
semver.satisfies(DB_VERSION, '>=2.6.0'));
|
|
||||||
|
|
||||||
const customConfig = Object.assign({}, global.config, {
|
|
||||||
enableOptimisedFindOrCreate: DB_HAS_2_6_FEATURES,
|
|
||||||
});
|
|
||||||
|
|
||||||
suite(global.getDataSource(customConfig, juggler.DataSource), should, {
|
|
||||||
replaceOrCreateReportsNewInstance: DB_HAS_2_6_FEATURES,
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -28,22 +28,6 @@ describe(name, function() {
|
||||||
// === Operation hooks ==== //
|
// === Operation hooks ==== //
|
||||||
|
|
||||||
const suite = require('loopback-datasource-juggler/test/persistence-hooks.suite.js');
|
const suite = require('loopback-datasource-juggler/test/persistence-hooks.suite.js');
|
||||||
|
const customConfig = Object.assign({}, global.config);
|
||||||
const DB_VERSION = process.env.MONGODB_VERSION;
|
suite(global.getDataSource(customConfig, juggler.DataSource), should, {replaceOrCreateReportsNewInstance: false});
|
||||||
|
|
||||||
if (!DB_VERSION) {
|
|
||||||
console.log('The ENV variable MONGODB_VERSION is not set.' +
|
|
||||||
' Assuming MongoDB version 2.6 or newer.');
|
|
||||||
}
|
|
||||||
|
|
||||||
const DB_HAS_2_6_FEATURES = (!DB_VERSION ||
|
|
||||||
semver.satisfies(DB_VERSION, '>=2.6.0'));
|
|
||||||
|
|
||||||
const customConfig = Object.assign({}, global.config, {
|
|
||||||
enableOptimisedFindOrCreate: DB_HAS_2_6_FEATURES,
|
|
||||||
});
|
|
||||||
|
|
||||||
suite(global.getDataSource(customConfig, juggler.DataSource), should, {
|
|
||||||
replaceOrCreateReportsNewInstance: DB_HAS_2_6_FEATURES,
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue