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
![]() |
|||
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
|
|||
32 | chai.expect(result).to.equal(folderPath) |
||
33 | sinon.assert.calledOnce(coreUtils.file.removeFolder) |
||
34 | coreUtils.file.removeFolder.restore() |
||
35 | }); |
||
36 | |||
37 | }); |
||
38 |