2016-08-22 19:55:22 +00:00
|
|
|
'use strict';
|
|
|
|
|
2018-12-07 16:13:48 +00:00
|
|
|
const debug = require('debug')('test');
|
|
|
|
const fs = require('fs');
|
|
|
|
const path = require('path');
|
2016-04-12 12:20:25 +00:00
|
|
|
|
|
|
|
module.exports = function(dataSource, should, connectorCapabilities) {
|
2018-12-07 16:13:48 +00:00
|
|
|
let operations = fs.readdirSync(__dirname);
|
2016-04-12 12:20:25 +00:00
|
|
|
operations = operations.filter(function(it) {
|
|
|
|
return it !== path.basename(__filename) &&
|
|
|
|
!!require.extensions[path.extname(it).toLowerCase()];
|
|
|
|
});
|
2018-12-07 16:13:48 +00:00
|
|
|
for (const ix in operations) {
|
|
|
|
const name = operations[ix];
|
|
|
|
const fullPath = require.resolve('./' + name);
|
2016-04-12 12:20:25 +00:00
|
|
|
debug('Loading test suite %s (%s)', name, fullPath);
|
|
|
|
require(fullPath).apply(this, arguments);
|
|
|
|
}
|
|
|
|
};
|