/* globals Twitch */
import RSVP from 'rsvp';
import Ember from 'ember';

const { K : emberK } = Ember;

let originalAsyncAds;
export function setup() {
  originalAsyncAds = Twitch.asyncAds;

  Twitch.asyncAds = {
    enable: emberK,
    prepareCompanionAds: function() { return RSVP.resolve(); },
    setMetadata: emberK,
    displayAdLight: emberK,
    afterCompanionAdsRendered: emberK,
    fetchAds: emberK,
    ready: emberK,
    metadata: {}
  };
}

export function teardown() {
  Twitch.asyncAds = originalAsyncAds;
}
