test/storage/storage-s3-tests.js
// fighting over the global AWS mocking stuff. I hate mocha...there's probably a better way...
fighting over the global AWS mocking stuff. I hate mocha...there's probably a better way
fighting over the global AWS mocking stuff . I hate mocha ... there ' s probably a better way
function mockerise(service, method) {
    const handlers = [];
    beforeEach(() => {
        AWS.mock(service, method, (q, callback) => {
            const qh = handlers.shift();
            should.exist(qh);
            try {
                callback(null, qh(q));
            } catch (e) {
                callback(e, null);
            }
        });
    });
    afterEach(() => {
        AWS.restore(service, method);
    });
    return handlers;
}
function mockerise ( service , method ) { const handlers = [ ] ; beforeEach ( ( ) => { AWS . mock ( service , method , ( q , callback ) => { const qh = handlers . shift ( ) ; should . exist ( qh ) ; try { callback ( null , qh ( q ) ) ; } catch ( e ) { callback ( e , null ) ; } } ) ; } ) ; afterEach ( ( ) => { AWS . restore ( service , method ) ; } ) ; return handlers ; }
fighting over the global AWS mocking stuff.
fighting over the global AWS mocking stuff .