define([
    'utils/events'
], function (Events) {
    /**
     * Rockabox JSHook class, it will setup custom hooks set in the Placement js
     * for Load, Init, View initial, Engagement and Click.
     *
     * @param {object} advert      The Advert class
     * @param {object} customHooks Custom hooks set within Placement js
     */
    function JSHooks (advert, customHooks) {
        var $this = this,
            events = new Events(),
            hooks = [
                'load',
                'init',
                'viewInitial',
                'engagement',
                'click'
            ];

        /**
         * Initializes the js hooks
         */
        function init () {
            for (var hook in hooks) {
                var hookName = hooks[hook],
                    hookEvent = 'rb.' + hookName;

                events.addListener(advert.getCreative(), hookEvent, customHooks[hookName]);
            }
        }

        init();
    }

    return JSHooks;
});

define([
    'utils/events'
], function (Events) {
    var events = new Events();
    /**
     * Rockabox JSHook class, it will setup custom hooks set in the Placement js
     * for Load, Init, View initial, Engagement and Click.
     *
     * @param {object} advert      The Advert class
     * @param {object} customHooks Custom hooks set within Placement js
     */
    function JSHooks (advert, customHooks) {
        var $this = this,
            hooks = [
                'load',
                'init',
                'viewInitial',
                'engagement',
                'click'
            ];

        /**
         * Initializes the js hooks
         */
        function init () {
            for (var hook in hooks) {
                var hookName = hooks[hook],
                    hookEvent = 'rb.' + hookName;

                events.addListener(advert.getCreative(), hookEvent, customHooks[hookName]);
            }
        }

        init();
    }

    return {
        init: JSHooks,
        events: events
    };
});

Split out Load Creative & JSHooks test fix
Split out Load Creative & JSHooks test fix
