fixup!: update test file
This commit is contained in:
parent
2316300b9a
commit
c07f169ca1
|
@ -5,7 +5,6 @@
|
|||
|
||||
'use strict';
|
||||
|
||||
const semver = require('semver');
|
||||
const should = require('should');
|
||||
const juggler = require('loopback-datasource-juggler');
|
||||
const name = require('./package.json').name;
|
||||
|
@ -28,22 +27,6 @@ describe(name, function() {
|
|||
// === Operation hooks ==== //
|
||||
|
||||
const suite = require('loopback-datasource-juggler/test/persistence-hooks.suite.js');
|
||||
|
||||
const DB_VERSION = process.env.MONGODB_VERSION;
|
||||
|
||||
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,
|
||||
});
|
||||
const customConfig = Object.assign({}, global.config);
|
||||
suite(global.getDataSource(customConfig, juggler.DataSource), should, {replaceOrCreateReportsNewInstance: false});
|
||||
});
|
||||
|
|
|
@ -28,22 +28,6 @@ describe(name, function() {
|
|||
// === Operation hooks ==== //
|
||||
|
||||
const suite = require('loopback-datasource-juggler/test/persistence-hooks.suite.js');
|
||||
|
||||
const DB_VERSION = process.env.MONGODB_VERSION;
|
||||
|
||||
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,
|
||||
});
|
||||
const customConfig = Object.assign({}, global.config);
|
||||
suite(global.getDataSource(customConfig, juggler.DataSource), should, {replaceOrCreateReportsNewInstance: false});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue