diff --git a/packages/vvisp-utils/test/getPrivateKey.test.js b/packages/vvisp-utils/test/getPrivateKey.test.js index b5df42d..d732171 100644 --- a/packages/vvisp-utils/test/getPrivateKey.test.js +++ b/packages/vvisp-utils/test/getPrivateKey.test.js @@ -58,15 +58,12 @@ describe('# getPrivateKey test', function() { }); }); describe('private key enable', function() { - const mnemonic = process.env.MNEMONIC; const private_key = process.env.PRIVATE_KEY; before(function() { - delete process.env.MNEMONIC; process.env.PRIVATE_KEY = '9741fa712a6912b862c9043f8752ffae513cb01895985998c61620da5aaf2d2d'; }); after(function() { - process.env.MNEMONIC = mnemonic; process.env.PRIVATE_KEY = private_key; }); it('should pass when private key given', function() { @@ -74,10 +71,7 @@ describe('# getPrivateKey test', function() { result.should.equal(process.env.PRIVATE_KEY); }); it('should return private key instead of mnemonic', function() { - const result = getPrivateKey( - 'piano garage flag neglect spare title drill basic strong aware enforce fury', - 3 - ); + const result = getPrivateKey(MNEMONIC, 3); result.should.equal(process.env.PRIVATE_KEY); }); }); diff --git a/packages/vvisp/test/scripts/deploy-contract.test.js b/packages/vvisp/test/scripts/deploy-contract.test.js index c480613..e5f5232 100644 --- a/packages/vvisp/test/scripts/deploy-contract.test.js +++ b/packages/vvisp/test/scripts/deploy-contract.test.js @@ -21,15 +21,22 @@ describe('# deploy contract process test', function() { .fulfilled; }); - it('should deploy one contract through private key', async () => { - process.env.PRIVATE_KEY = - '9741fa712a6912b862c9043f8752ffae513cb01895985998c61620da5aaf2d2d'; - process.env.MNEMONIC = ''; - await deployContract(CONTRACT_PATH, [], { silent: true }).should.be - .fulfilled; - process.env.PRIVATE_KEY = ''; - process.env.MNEMONIC = - 'piano garage flag neglect spare title drill basic strong aware enforce fury'; + describe('private key', function() { + const mnemonic = process.env.MNEMONIC; + const private_key = process.env.PRIVATE_KEY; + before(function() { + process.env.PRIVATE_KEY = + '9741fa712a6912b862c9043f8752ffae513cb01895985998c61620da5aaf2d2d'; + delete process.env.MNEMONIC; + }); + after(function() { + process.env.MNEMONIC = mnemonic; + process.env.PRIVATE_KEY = private_key; + }); + it.only('should deploy one contract through private key', async () => { + await deployContract(CONTRACT_PATH, [], { silent: true }).should.be + .fulfilled; + }); }); it('should deploy two contract', async () => {