Tests for parseCookie, serializeCookie, shuffle

This commit is contained in:
Angelos Chalaris
2018-02-03 12:32:46 +02:00
parent 5e16bcbcc8
commit 73fe3b95da
4 changed files with 13 additions and 6 deletions

View File

@ -5,9 +5,10 @@ test('Testing parseCookie', (t) => {
//For more information on all the methods supported by tape
//Please go to https://github.com/substack/tape
t.true(typeof parseCookie === 'function', 'parseCookie is a Function');
t.deepEqual(parseCookie('foo=bar; equation=E%3Dmc%5E2'), { foo: 'bar', equation: 'E=mc^2' }, 'Parses the cookie');
//t.deepEqual(parseCookie(args..), 'Expected');
//t.equal(parseCookie(args..), 'Expected');
//t.false(parseCookie(args..), 'Expected');
//t.throws(parseCookie(args..), 'Expected');
t.end();
});
});

View File

@ -5,9 +5,10 @@ test('Testing serializeCookie', (t) => {
//For more information on all the methods supported by tape
//Please go to https://github.com/substack/tape
t.true(typeof serializeCookie === 'function', 'serializeCookie is a Function');
t.equal(serializeCookie('foo', 'bar'), 'foo=bar', 'Serializes the cookie');
//t.deepEqual(serializeCookie(args..), 'Expected');
//t.equal(serializeCookie(args..), 'Expected');
//t.false(serializeCookie(args..), 'Expected');
//t.throws(serializeCookie(args..), 'Expected');
t.end();
});
});

View File

@ -5,9 +5,11 @@ test('Testing shuffle', (t) => {
//For more information on all the methods supported by tape
//Please go to https://github.com/substack/tape
t.true(typeof shuffle === 'function', 'shuffle is a Function');
const arr = [1,2,3,4,5,6];
t.notDeepEqual(shuffle(arr), arr, 'Shuffles the array');
//t.deepEqual(shuffle(args..), 'Expected');
//t.equal(shuffle(args..), 'Expected');
//t.false(shuffle(args..), 'Expected');
//t.throws(shuffle(args..), 'Expected');
t.end();
});
});

View File

@ -1,4 +1,4 @@
Test log for: Sat Feb 03 2018 12:25:38 GMT+0200 (GTB Standard Time)
Test log for: Sat Feb 03 2018 12:32:27 GMT+0200 (GTB Standard Time)
> 30-seconds-of-code@0.0.1 test G:\My Files\git Repositories\30-seconds-of-code
> tape test/**/*.test.js | tap-spec
@ -1010,6 +1010,7 @@ Test log for: Sat Feb 03 2018 12:25:38 GMT+0200 (GTB Standard Time)
Testing parseCookie
√ parseCookie is a Function
√ Parses the cookie
Testing partial
@ -1211,6 +1212,7 @@ Test log for: Sat Feb 03 2018 12:25:38 GMT+0200 (GTB Standard Time)
Testing serializeCookie
√ serializeCookie is a Function
√ Serializes the cookie
Testing setStyle
@ -1229,6 +1231,7 @@ Test log for: Sat Feb 03 2018 12:25:38 GMT+0200 (GTB Standard Time)
Testing shuffle
√ shuffle is a Function
√ Shuffles the array
Testing similarity
@ -1645,8 +1648,8 @@ Test log for: Sat Feb 03 2018 12:25:38 GMT+0200 (GTB Standard Time)
√ Works with multiple promises
total: 749
passing: 749
total: 752
passing: 752
duration: 2.4s