spec/helper.js
function () {
        var waterline = this.injector.get('Services.Waterline');

        return bluebird.all(
            _.map(waterline, function (collection) {
                if (typeof collection.destroy === 'function') {
                    return bluebird.fromNode(collection.destroy.bind(collection)).then(function () {
                        if (collection.adapterDictionary.define !== 'mongo') {
                            return bluebird.fromNode(
                                collection.adapter.define.bind(collection.adapter)
                            );
                        }
                    });
                }
            })
        );
    }
function () {
        var waterline = this.injector.get('Services.Waterline');

        return bluebird.all(
            _.map(waterline, function (collection) {
                if (typeof collection.destroy === 'function') {
                    return bluebird.fromNode(collection.destroy.bind(collection)).then(function () {
                        if (collection.adapterDictionary.define !== 'mongo') {
                            return bluebird.fromNode(
                                collection.adapter.define.bind(collection.adapter)
                            );
                        }
                    });
                }
            })
        );
    }
function ( ) { var waterline = this . injector . get ( 'Services.Waterline' ) ; return bluebird . all ( _ . map ( waterline , function ( collection ) { if ( typeof collection . destroy === 'function' ) { return bluebird . fromNode ( collection . destroy . bind ( collection ) ) . then ( function ( ) { if ( collection . adapterDictionary . define !== 'mongo' ) { return bluebird . fromNode ( collection . adapter . define . bind ( collection . adapter ) ) ; } } ) ; } } ) ) ; }
maps through all collections loaded into Services.Waterline
and destroys them to reset testing state.

Usage:

beforeEach(function() {
this.timeout(5000); // gives the system 5 seconds to do the wiping
return waterline.start().then(function() {
return helper.reset();
})
})

@returns {Promise}
maps through all collections loaded into Services . Waterline and destroys them to reset testing state .