All files / src/tests/integrationTests keys.js

100% Statements 17/17
100% Branches 0/0
100% Functions 1/1
100% Lines 17/17
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 311x 1x 1x   1x 1x   1x 1x 1x 1x       1x   1x     1x   1x 1x   1x   1x     1x  
const path = require('path')
const assert = require('assert')
const interbit = require('../../')
 
const prepareTestLocation = require('./prepareTestLocation')
const log = require('../../log')
 
const testKeys = async () => {
  const { location, cleanup } = prepareTestLocation('keys')
  const filename = path.join(location, 'keys.json')
  const options = {
    filename
  }
 
  await interbit.keys(options)
 
  log.info('Generated keys')
 
  // eslint-disable-next-line
  const keys = require(path.join(process.cwd(), filename))
 
  assert.ok(keys.publicKey)
  assert.ok(keys.privateKey)
 
  log.success('Successfully generated a key pair')
 
  cleanup()
}
 
module.exports = testKeys