Completed
Push — dev ( 6ada4c...6e0845 )
by Fike
31s
created

test/suite/unit/Utility/Objects.spec.js   A

Complexity

Total Complexity 9
Complexity/F 1

Size

Lines of Code 33
Function Count 9

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 0
c 1
b 0
f 0
nc 1
dl 0
loc 33
rs 10
wmc 9
mnd 0
bc 9
fnc 9
bpm 1
cpm 1
noi 0
1
/* eslint-env mocha */
2
/* global allure */
3
4
var Chai = require('chai')
5
var expect = Chai.expect
6
7
var Objects = require('../../../../lib/Utility/Objects').Objects
8
9
describe('Unit', function () {
10
  describe('/Utility', function () {
11
    describe('/Objects.js', function () {
12
      describe('.Objects', function () {
13
        describe('.copy', function () {
14
          var variants = [1, 1.0, true, false, null, undefined, 'string']
15
          variants.forEach(function (value) {
16
            it('passes through primitive value', function () {
17
              allure.addArgument('input', value)
18
              expect(Objects.copy(value)).to.equal(value)
19
            })
20
          })
21
22
          it('copies array contents', function () {
23
            var value = [1, 2, 3]
24
            var copy = Objects.copy(value)
25
            expect(copy).not.to.equal(value)
26
            expect(copy).to.deep.eq(value)
27
          })
28
        })
29
30
        describe('.merge', function () {
31
          // TODO: write tests for all cases
32
        })
33
      })
34
    })
35
  })
36
})
37