<commit_before>
var expect = require('expect.js');
var Cookie = require('../index');

describe('Cookie', function() {

    describe('get', function() {

        document.cookie = '_sea_test_1=1';
        document.cookie = '_sea_test_2';
        document.cookie = '_sea_test_3=';
        document.cookie = '_sea_test_4[t]=xx';

        it.skip('should return the cookie value for the given name.', function() {

            expect(Cookie.get('_sea_test_1')).to.equal('1');
            expect(Cookie.get('_sea_test_2')).to.equal('');
            expect(Cookie.get('_sea_test_3')).to.equal('');
            expect(Cookie.get('_sea_test_4[t]')).to.equal('xx');

        });

        it('should return undefined for non-existing name.', function() {

            expect(Cookie.get('_sea_test_none')).to.equal(undefined);
            expect(function(){ Cookie.get(true); }).to.throwError();
            expect(function(){ Cookie.get({}); }).to.throwError();
            expect(function(){ Cookie.get(null); }).to.throwError();

        });

        it('should throw error for invalid name.', function() {

            expect(function(){ Cookie.get(true); }).to.throwError();
            expect(function(){ Cookie.get({}); }).to.throwError();
            expect(function(){ Cookie.get(null); }).to.throwError();

        });

    });

    describe('set', function() {

        it('should set a cookie with a given name and value.', function() {

            Cookie.set('_sea_test_11', 'xx');
            expect(Cookie.get('_sea_test_11')).to.equal('xx');

            Cookie.set('_sea_test_12', 'xx', { expires: -1 });
            expect(Cookie.get('_sea_test_12')).to.equal(undefined);

            Cookie.set('_sea_test_13', '2', {
                expires: new Date(2099, 1, 1),
                path: '/'
            });
            expect(Cookie.get('_sea_test_13')).to.equal('2');

            Cookie.remove('_sea_test_14');
            Cookie.set('_sea_test_14', '4', {<commit_msg>Removed duplicated tests<commit_after>
var expect = require('expect.js');
var Cookie = require('../index');

describe('Cookie', function() {

    describe('get', function() {

        document.cookie = '_sea_test_1=1';
        document.cookie = '_sea_test_2';
        document.cookie = '_sea_test_3=';
        document.cookie = '_sea_test_4[t]=xx';

        it.skip('should return the cookie value for the given name.', function() {

            expect(Cookie.get('_sea_test_1')).to.equal('1');
            expect(Cookie.get('_sea_test_2')).to.equal('');
            expect(Cookie.get('_sea_test_3')).to.equal('');
            expect(Cookie.get('_sea_test_4[t]')).to.equal('xx');

        });

        it('should return undefined for non-existing name.', function() {

            expect(Cookie.get('_sea_test_none')).to.equal(undefined);

        });

        it('should throw error for invalid name.', function() {

            expect(function(){ Cookie.get(true); }).to.throwError();
            expect(function(){ Cookie.get({}); }).to.throwError();
            expect(function(){ Cookie.get(null); }).to.throwError();

        });

    });

    describe('set', function() {

        it('should set a cookie with a given name and value.', function() {

            Cookie.set('_sea_test_11', 'xx');
            expect(Cookie.get('_sea_test_11')).to.equal('xx');

            Cookie.set('_sea_test_12', 'xx', { expires: -1 });
            expect(Cookie.get('_sea_test_12')).to.equal(undefined);

            Cookie.set('_sea_test_13', '2', {
                expires: new Date(2099, 1, 1),
                path: '/'
            });
            expect(Cookie.get('_sea_test_13')).to.equal('2');

            Cookie.remove('_sea_test_14');
            Cookie.set('_sea_test_14', '4', {
{'fraction_non_alphanumeric': 0.18676939426142403, 'fraction_numerical': 0.019128586609989374, 'mean_word_length': 2.4258416742493174, 'pattern_counts': {'":': 0, '<': 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': '1317063', 'n_tokens_mistral': 1193, 'n_tokens_neox': 1118, 'n_words': 191}