<commit_before>define([
  'common/collections/visitors-realtime',
  'extensions/collections/collection'
],
function (VisitorsRealtimeCollection, Collection) {
  describe("VisitorsRealtimeCollection", function () {

    beforeEach(function() {
      jasmine.Clock.useMock();
      spyOn(VisitorsRealtimeCollection.prototype, "fetch");
      spyOn(Collection.prototype, "fetch");
    });

    it("auto-updates on the client", function () {
      jasmine.clientOnly(function () {
        var collection = new VisitorsRealtimeCollection();
        expect(collection.fetch).not.toHaveBeenCalled();
        jasmine.Clock.tick(120 * 1000 - 1);
        expect(collection.fetch).not.toHaveBeenCalled();
        jasmine.Clock.tick(1);
        expect(collection.fetch).toHaveBeenCalled();
      });
    });

    it("does not auto-update on the server", function () {
      jasmine.serverOnly(function () {
        var collection = new VisitorsRealtimeCollection();
        expect(collection.fetch).not.toHaveBeenCalled();
        jasmine.Clock.tick(120 * 1000);
        expect(collection.fetch).not.toHaveBeenCalled();
      });
    });

    it("sets cache headers correctly", function () {
      var collection = new VisitorsRealtimeCollection();
      collection.fetch.andCallThrough();
      collection.fetch();
      expect(Collection.prototype.fetch).toHaveBeenCalled();
      var args = Collection.prototype.fetch.argsForCall[0][0];
      expect(args).toEqual({
        ifModified: true,
        headers: {"cache-control": "max-age=120"}
      });
    });
  });
});<commit_msg>Fix failing test<commit_after>define([
  'common/collections/visitors-realtime',
  'extensions/collections/collection'
],
function (VisitorsRealtimeCollection, Collection) {
  describe("VisitorsRealtimeCollection", function () {

    beforeEach(function() {
      jasmine.Clock.useMock();
      spyOn(VisitorsRealtimeCollection.prototype, "fetch");
      spyOn(Collection.prototype, "fetch");
    });

    it("auto-updates on the client", function () {
      jasmine.clientOnly(function () {
        var collection = new VisitorsRealtimeCollection();
        expect(collection.fetch).not.toHaveBeenCalled();
        jasmine.Clock.tick(120 * 1000 - 1);
        expect(collection.fetch).not.toHaveBeenCalled();
        jasmine.Clock.tick(1);
        expect(collection.fetch).toHaveBeenCalled();
      });
    });

    it("does not auto-update on the server", function () {
      jasmine.serverOnly(function () {
        var collection = new VisitorsRealtimeCollection();
        expect(collection.fetch).not.toHaveBeenCalled();
        jasmine.Clock.tick(120 * 1000);
        expect(collection.fetch).not.toHaveBeenCalled();
      });
    });

    it("sets cache headers correctly", function () {
      var collection = new VisitorsRealtimeCollection();
      collection.fetch.andCallThrough();
      collection.fetch();
      expect(Collection.prototype.fetch).toHaveBeenCalled();
      var args = Collection.prototype.fetch.argsForCall[0][0];
      expect(args).toEqual({
        headers: {"cache-control": "max-age=120"}
      });
    });
  });
});
{'fraction_non_alphanumeric': 0.14290291573213715, 'fraction_numerical': 0.013457225248317847, 'mean_word_length': 3.2825788751714677, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1461702', 'n_tokens_mistral': 902, 'n_tokens_neox': 867, 'n_words': 136}