spec/lib/jobs/poweron-node-spec.js
function() {
        function MockWaterline() {}
        MockWaterline.prototype.nodes = {};
        MockWaterline.prototype.nodes.findByIdentifier = function (nodeId) {
                //return instance of a node with settings in it...
                return Promise.resolve({
                    obmSettings: [
                        {
                            service: 'ipmi-obm-service',
                            config: {
                                'user': 'ADMIN',
                                'password': 'ADMIN',
                                'host': '192.192.192.192'
                            }
                        }
                    ],
                    id: nodeId
                });
        };
        return new MockWaterline();
    }
function() {
        function MockWaterline() {}
        MockWaterline.prototype.nodes = {};
        MockWaterline.prototype.nodes.findByIdentifier = function (nodeId) {
                //return instance of a node with settings in it...
                return Promise.resolve({
                    obmSettings: [
                        {
                            service: 'ipmi-obm-service',
                            config: {
                                'user': 'ADMIN',
                                'password': 'ADMIN',
                                'host': '192.192.192.192'
                            }
                        }
                    ],
                    id: nodeId
                });
        };
        return new MockWaterline();
    }
function ( ) { function MockWaterline ( ) { } MockWaterline . prototype . nodes = { } ; MockWaterline . prototype . nodes . findByIdentifier = function ( nodeId ) { //return instance of a node with settings in it... return Promise . resolve ( { obmSettings : [ { service : 'ipmi-obm-service' , config : { 'user' : 'ADMIN' , 'password' : 'ADMIN' , 'host' : '192.192.192.192' } } ] , id : nodeId } ) ; } ; return new MockWaterline ( ) ; }
mock up the Services.Waterline injectable to subvert model lookups for our tests
mock up the Services . Waterline injectable to subvert model lookups for our tests