Icontem

File: test/core/cookies.js

Recommend this page to a friend!
  Classes of Sebastian Schlapkohl  >  jQuery Annex  >  test/core/cookies.js  >  Download  
File: test/core/cookies.js
Role: Example script
Content type: text/plain
Description: Example script
Class: jQuery Annex
General purpose functions missing in jQuery
Author: By
Last change:
Date: 9 months ago
Size: 743 bytes
 

Contents

Class file image Download
import test from 'ava';



$versions.forEach($ => {
	let jqueryVersionString = ' @ jQuery '+$().jquery;



	test('$.cookie'+jqueryVersionString, (assert) => {
		assert.notThrows(() => { $.cookie('kittencookie', 'fluffy', {expires : 7}); });
		assert.is($.cookie('kittencookie'), 'fluffy');
		assert.notThrows(() => { $.cookie('foobarcookie', ':::///___abc123', {expires : new Date()}); });
		assert.is($.cookie('foobarcookie'), null);
		assert.notThrows(() => { $.cookie('foobarcookie', ':::///___abc123', {expires : 1}); });
		assert.is($.cookie('foobarcookie'), ':::///___abc123');
		assert.notThrows(() => { $.cookie('foobarcookie', null); });
		assert.is($.cookie('foobarcookie'), null);
	});
});