diff --git a/test/utils/createUtil.test.ts b/test/utils/createUtil.test.ts index c5be0c58..45664f2e 100644 --- a/test/utils/createUtil.test.ts +++ b/test/utils/createUtil.test.ts @@ -11,6 +11,7 @@ import { assert, expect } from 'chai'; import * as fs from 'fs'; import * as path from 'path'; import { SinonStub, stub } from 'sinon'; +import * as os from 'os'; /* tslint:disable: no-unused-expression */ describe('CreateUtil', () => { @@ -88,6 +89,20 @@ describe('CreateUtil', () => { }; }); + describe('DIR', () => { + let homedirStub: SinonStub; + beforeEach(() => { + homedirStub = stub(os, 'homedir'); + }); + it('should return DIR', () => { + const homedir = '/Users/johndoe'; + homedirStub.returns(homedir); + const sfdxStateFolder = '.sfdx'; + const dir = CreateUtil.DIR; + expect(dir).to.eql(path.join(homedir, sfdxStateFolder)); + }); + }); + describe('getCommandTemplatesInSubdirs', () => { const templateType = 'lightningcomponent'; const templatePath = path.resolve(