var assert = require('assert') var KeyringController = require('../../app/scripts/keyring-controller') var configManagerGen = require('../lib/mock-config-manager') const ethUtil = require('ethereumjs-util') const async = require('async') describe('KeyringController', function() { describe('#createNewVault', function () { let keyringController let password = 'password123' let entropy = 'entripppppyy duuude' let seedWords let accounts = [] let originalKeystore before(function(done) { window.localStorage = {} // Hacking localStorage support into JSDom keyringController = new KeyringController({ configManager: configManagerGen(), ethStore: { addAccount(acct) { accounts.push(ethUtil.addHexPrefix(acct)) }, }, }) keyringController.createNewVault(password, entropy, (err, seeds) => { assert.ifError(err, 'createNewVault threw error') seedWords = seeds originalKeystore = keyringController._idmgmt.keyStore done() }) }) }) })