Bug:Fix file validation issue
[vnfsdk/refrepo.git] / vnfmarket / src / main / webapp / vnfmarket / node_modules / i / test / utils / array-test.js
1 (function() {
2   var assert, vows, util;
3
4   vows = require('vows');
5
6   assert = require('assert');
7
8   util = require('../../lib/util');
9
10   vows.describe('Module core extension Array').addBatch({
11     'Testing del': {
12       topic: ['a', 'b', 'c'],
13       'element exists': {
14         'first element': function(topic) {
15           return assert.deepEqual(util.array.del(topic, 'a'), ['b', 'c']);
16         },
17         'middle element': function(topic) {
18           return assert.deepEqual(util.array.del(topic, 'b'), ['a', 'c']);
19         },
20         'last element': function(topic) {
21           return assert.deepEqual(util.array.del(topic, 'c'), ['a', 'b']);
22         }
23       },
24       'element does not exist': function(topic) {
25         return assert.deepEqual(util.array.del(topic, 'd'), ['a', 'b', 'c']);
26       }
27     },
28     'Testing utils': {
29       topic: ['a', 'b', 'c'],
30       'first': function(topic) {
31         return assert.equal(util.array.first(topic), 'a');
32       },
33       'last': function(topic) {
34         return assert.equal(util.array.last(topic), 'c');
35       }
36     }
37   })["export"](module);
38
39 }).call(this);