-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest.js
30 lines (26 loc) · 779 Bytes
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
var arrayTypeOfValues = require('./');
var expect = require('chai').expect;
describe('arrayTypeOfValues(array)', function()
{
it('returns undefined for an empty array', function()
{
expect(arrayTypeOfValues([])).to.equal(undefined);
}
);
it('returns a primitive type for an array of one type', function()
{
expect(arrayTypeOfValues(['fee', 'fi', 'fo', 'fum'])).to.equal('string');
}
);
it('returns "array" for an array of arrays', function()
{
expect(arrayTypeOfValues([['test'], [], [25]])).to.equal('array');
}
);
it('returns a common superclass for a mixed-type array', function()
{
expect(arrayTypeOfValues([1, 2, 'three'])).to.equal('object');
}
);
}
);