<commit_before>'use strict';

describe('The Xos Backbone', () => {
  describe('get_defaults mehod', () => {

    beforeEach(() => {
      xosdefaults = {
        test: {config: true}
      };
    });

    it('should return default config', () => {
      let res = get_defaults('test');
      expect(res).toEqual({config: true});
    });

    it('should return undefined', () => {
      let res = get_defaults('notset');
      expect(res).toBeUndefined();
    });

  });<commit_msg>Tested extend_defaults and getCookie methods<commit_after>'use strict';

describe('The Xos Backbone', () => {
  
  beforeEach(() => {
    xosdefaults = {
      test: {config: true}
    };
  });

  describe('get_defaults mehod', () => {

    it('should return default config', () => {
      let res = get_defaults('test');
      expect(res).toEqual({config: true});
    });

    it('should return undefined', () => {
      let res = get_defaults('notset');
      expect(res).toBeUndefined();
    });

  });

  describe('The extend_defaults method', () => {
    
    it('should return an extended config', () => {
      let extended = extend_defaults('test', {extended: true});
      expect(extended).toEqual({config: true, extended: true});
    });

    it('should return an new config', () => {
      let extended = extend_defaults('notset', {extended: true});
      expect(extended).toEqual({extended: true});
    });

  });

  describe('getCookie method with no cookie', () => {
    it('should return null', () => {
      let res = getCookie('fakeCookie');
      expect(res).toBeNull();
    });
  });

  describe('getCookie method with a fake cookie', () => {
  
    beforeEach(() => {
      document.cookie = 'fakeCookie=true';
    });
  
    it('should return a cookie value', () => {
      let res = getCookie('fakeCookie');
      expect(res).toEqual('true');
    });
  });
{'fraction_non_alphanumeric': 0.1909628832705756, 'fraction_numerical': 0.0, 'mean_word_length': 2.8912133891213387, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 21, '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': '1078875', 'n_tokens_mistral': 562, 'n_tokens_neox': 546, 'n_words': 119}