Create solc_bin dir if does not exist before attempting to compile

This commit is contained in:
Amir Bandeali
2018-03-31 23:54:56 -07:00
parent 1bac5019e8
commit 20fec2943b
4 changed files with 16 additions and 13 deletions

View File

@@ -3,7 +3,7 @@ import * as dirtyChai from 'dirty-chai';
import 'mocha';
import {
createArtifactsDirIfDoesNotExistAsync,
createDirIfDoesNotExistAsync,
getNormalizedErrMsg,
parseDependencies,
parseSolidityVersionRange,
@@ -21,11 +21,11 @@ describe('Compiler utils', () => {
expect(normalizedErrMsg).to.be.equal('Token.sol:6:46: Warning: Unused local variable');
});
});
describe('#createArtifactsDirIfDoesNotExistAsync', () => {
describe('#createDirIfDoesNotExistAsync', () => {
it('creates artifacts dir', async () => {
const artifactsDir = `${__dirname}/artifacts`;
expect(fsWrapper.doesPathExistSync(artifactsDir)).to.be.false();
await createArtifactsDirIfDoesNotExistAsync(artifactsDir);
await createDirIfDoesNotExistAsync(artifactsDir);
expect(fsWrapper.doesPathExistSync(artifactsDir)).to.be.true();
fsWrapper.rmdirSync(artifactsDir);
expect(fsWrapper.doesPathExistSync(artifactsDir)).to.be.false();