Guest User

Untitled

a guest
Oct 22nd, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. /*jslint node: true, nomen: true, sloppy: true, newcap: true */
  2.  
  3. var vows = require('vows'),
  4. utils = require('./util');
  5.  
  6. vows.describe('array stuffs').addBatch(util.parallelize({
  7. 'when I have an array': {
  8. topic: function () {
  9. return [1, 2, 3];
  10. },
  11. 'and I push': {
  12. topic: function (data) {
  13. data.push(4);
  14. return data;
  15. },
  16. 'it adds 4 to the list': function (data) {
  17. assert.equal(data.toString(), '1,2,3,4');
  18. }
  19. },
  20. 'and I pop': {
  21. topic: function (data) {
  22. data.pop();
  23. return data;
  24. },
  25. 'it has 2 items': function (data) {
  26. assert.equal(data.length, 2);
  27. }
  28. }
  29. }
  30. })).exportTo(module);
Add Comment
Please, Sign In to add comment