Completed
Pull Request — master (#66)
by
unknown
02:04
created

test/cms/structure/structure.js   A

Complexity

Total Complexity 2
Complexity/F 1

Size

Lines of Code 37
Function Count 2

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 0
nc 1
dl 0
loc 37
rs 10
c 2
b 0
f 0
wmc 2
mnd 0
bc 2
fnc 2
bpm 1
cpm 1
noi 2

1 Function

Rating   Name   Duplication   Size   Complexity  
A structure.js ➔ describe(ꞌcmsStructureꞌ) 0 20 1
1
import chai from 'chai'
2
import path from 'path'
3
import sinonChai from'sinon-chai'
4
chai.use(sinonChai)
5
import sinon from 'sinon'
6
import execPromise from 'child-process-promise'
7
import mkdirp from 'mkdirp'
8
import events from 'events'
9
import {
10
  cmsStructure,
11
  abeExtend,
0 ignored issues
show
Unused Code introduced by
The variable abeExtend seems to be never used. Consider removing it.
Loading history...
12
  coreUtils,
13
  config
14
} from '../../../src/cli'
15
16
config.set({root: path.join(process.cwd(), 'test','fixtures')})
17
18
describe('cmsStructure', function() {
19
20
  var folderPath = '/my/folder/path'
21
  
22
  /**
23
   * cmsStructure.structure.editStructure
24
   * 
25
   */
26
  it('cmsStructure.structure.editStructure()', function() {
27
    this.sinon = sinon.sandbox.create();
28
    var stub = sinon.stub(coreUtils.file, "removeFolder")
29
    stub.returns('')
30
    var result = cmsStructure.structure.editStructure('remove', folderPath)
31
    chai.expect(result).to.not.be.undefined
0 ignored issues
show
introduced by
The result of the property access to chai.expect(result).to.not.be.undefined is not used.
Loading history...
32
    chai.expect(result).to.equal(folderPath)
33
    sinon.assert.calledOnce(coreUtils.file.removeFolder)
34
    coreUtils.file.removeFolder.restore()
35
  });
36
37
});
38