loopback-datasource-juggler/test/operation-hooks.suite/index.js

20 lines
617 B
JavaScript
Raw Normal View History

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');
module.exports = function(dataSource, should, connectorCapabilities) {
2018-12-07 16:13:48 +00:00
let operations = fs.readdirSync(__dirname);
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);
debug('Loading test suite %s (%s)', name, fullPath);
require(fullPath).apply(this, arguments);
}
};