Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. const assert = require('assert');
  2. const {
  3. parse,
  4. stringify
  5. } = require('../src/index');
  6.  
  7. describe('The package index.js', () => {
  8. const str = '?by=kati-frantz&popular=true&category=nodejs';
  9. const obj = { by:'kati-frantz', popular:'true', category:'nodejs'};
  10.  
  11. describe('The parse function', () => {
  12. it(`Should return an object ${obj} off all query params when ${str} is pass to it`, () => {
  13. const actual = parse(str);
  14. const expected = obj;
  15. assert.deepEqual(actual, expected);
  16. });
  17. });
  18. describe('The stringify function', () => {
  19. it(`Should return a string ${str} when a object ${obj} is pass to it `, () => {
  20. const actual = stringify(obj);
  21. const expected = str;
  22. assert.deepEqual(actual,expected);
  23. })
  24. })
  25.  
  26. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement