forked from DerivcoIpswich/dsharp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharray.spec.js
More file actions
38 lines (29 loc) · 875 Bytes
/
Copy patharray.spec.js
File metadata and controls
38 lines (29 loc) · 875 Bytes
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
31
32
33
34
35
36
37
38
describe('array', () => {
test('null returns null', () => {
//Arrange
const array = require(process.env['RUNTIME']).array;
//Act
const result = array(null);
//Assert
expect(result).toBeNull();
});
test('arguments is converted to array', () => {
//Arrange
const array = require(process.env['RUNTIME']).array;
//Act
const result = array(arguments);
//Assert
expect(Array.isArray(arguments)).toBe(false);
expect(Array.isArray(result)).toBe(true);
});
test('array is cloned', () => {
//Arrange
const array = require(process.env['RUNTIME']).array;
const arr = [1, 2, 3];
//Act
const result = array(arr);
//Assert
expect(result).not.toBe(arr);
expect(result).toEqual(arr);
});
});