All files / server/test options.js

100% Statements 6/6
40% Branches 2/5
100% Functions 1/1
100% Lines 5/5
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1628x 28x     28x     136x     131x          
const server = require('../');
const instance = require('./instance');
 
// Parse the server options
module.exports = (opts = {}, general = {}, defaults = {}) => {
 
  // A server.js instance or the promise of it, just return it
  if (instance(opts)) return opts;
 
  // Be able to set global variables from outside
  return Object.assign({}, defaults, general, opts, {
    env: undefined,
    secret: undefined
  });
};