Completed
Push — master ( e193d1...415e1b )
by Justin
01:32
created

test/atom/AtomCommon.js   A

Complexity

Total Complexity 4
Complexity/F 1

Size

Lines of Code 31
Function Count 4

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 31
rs 10
wmc 4
mnd 0
bc 4
fnc 4
bpm 1
cpm 1
noi 0

1 Function

Rating   Name   Duplication   Size   Complexity  
B AtomCommon.js ➔ describe(ꞌAtomCommonꞌ) 0 28 1
1
var assert = require('chai').assert,
2
    AtomCommon = require('../../src/atom/AtomCommon');
3
4
describe('AtomCommon', function(){
5
  
6
  it('init from JSON', function(){
7
    var common = AtomCommon({
8
      base: 'base',
9
      lang: 'lang'
10
    });
11
    assert.equal(common.getBase(), 'base');
12
    assert.equal(common.getLang(), 'lang');
13
  });
14
  
15
  it('build', function(){
16
    var common = AtomCommon()
17
      .setBase('base')
18
      .setLang('lang');
19
    assert.equal(common.getBase(), 'base');
20
    assert.equal(common.getLang(), 'lang');
21
  });
22
  
23
  it('toJSON', function(){
24
    var data = {
25
      base: 'base',
26
      lang: 'lang'
27
    };
28
    assert.deepEqual(AtomCommon(data).toJSON(), data);
29
  });
30
  
31
});