Blame view

node_modules/loopback-datasource-juggler/test/operation-hooks.suite/index.js 605 Bytes
f7563de62   Palak Handa   first commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
  'use strict';
  
  var debug = require('debug')('test');
  var fs = require('fs');
  var path = require('path');
  
  module.exports = function(dataSource, should, connectorCapabilities) {
    var operations = fs.readdirSync(__dirname);
    operations = operations.filter(function(it) {
      return it !== path.basename(__filename) &&
        !!require.extensions[path.extname(it).toLowerCase()];
    });
    for (var ix in operations) {
      var name = operations[ix];
      var fullPath = require.resolve('./' + name);
      debug('Loading test suite %s (%s)', name, fullPath);
      require(fullPath).apply(this, arguments);
    }
  };