describe("Moments", function() {
  var NO_ALLIES = "Unselect all";
  var ALL_ALLIES = "Select all";

    beforeAll(function() {
    var elements = [];
    elements.push("<div id='test_body'></div>");
    elements.push("<label id='viewers_label'></label>");
    elements.push("<input type='checkbox' id='viewers'></input>");
    for (var i = 0; i < elements.length; i++) {
      $(document.body).append(elements[i]);
    }

  });

  afterAll(function() {
    $("#test_body").remove();
    $("body").removeClass("moments new");
  });
  it("test no functions called", function() {
    var newOrEdit = spyOn(window, "newOrEdit");
    expect(newOrEdit).not.toHaveBeenCalled();
  });
  it("test onReadyMoments to be called", function() {
    var newOrEdit = spyOn(window, "newOrEdit");
    onReadyMoments();
    expect(newOrEdit).toHaveBeenCalled();
    expect($('#viewers_label').text()).toBe("");
  });
  it("test onReadyMoments and newOrEdit to be called", function() {
    $("body").addClass("moments new");
    onReadyMoments();
    expect($('#viewers_label').text()).toBe(ALL_ALLIES);
    onReadyMoments();
  });
  it("test newOeEdit in onReadyMoments to be called", function() {
    var newOrEdit = spyOn(window, "newOrEdit");
    onReadyMoments();
    expect(newOrEdit).toHaveBeenCalled();
  });
});

@@ -419,118 +419,15 @@
   %7D%0A
-%0A
   %7D);%0A%0A
-  afterAll(function() %7B%0A    $(%22#test_body%22).remove();%0A    $(%22body%22).removeClass(%22moments new%22);%0A  %7D);%0A
   it

Remove unused teardown function