ran npm run tdd
This commit is contained in:
8
test/parseCookie/parseCookie.js
Normal file
8
test/parseCookie/parseCookie.js
Normal file
@ -0,0 +1,8 @@
|
||||
module.exports = parseCookie = str =>
|
||||
str
|
||||
.split(';')
|
||||
.map(v => v.split('='))
|
||||
.reduce((acc, v) => {
|
||||
acc[decodeURIComponent(v[0].trim())] = decodeURIComponent(v[1].trim());
|
||||
return acc;
|
||||
}, {});
|
||||
13
test/parseCookie/parseCookie.test.js
Normal file
13
test/parseCookie/parseCookie.test.js
Normal file
@ -0,0 +1,13 @@
|
||||
const test = require('tape');
|
||||
const parseCookie = require('./parseCookie.js');
|
||||
|
||||
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(args..), 'Expected');
|
||||
//t.equal(parseCookie(args..), 'Expected');
|
||||
//t.false(parseCookie(args..), 'Expected');
|
||||
//t.throws(parseCookie(args..), 'Expected');
|
||||
t.end();
|
||||
});
|
||||
Reference in New Issue
Block a user