diff options
author | Thomas Huang <thomas.b.huang@gmail.com> | 2017-05-05 05:35:10 +0800 |
---|---|---|
committer | Thomas Huang <thomas.b.huang@gmail.com> | 2017-05-05 05:35:10 +0800 |
commit | 0b13429daf00ddd5bdf2705c7a95d7a9d5792f54 (patch) | |
tree | f249d8deb5fa48db54d70757de944b2c8ff76a2e /test/lib | |
parent | 8f5334e4aca8b95963f57b0fbf862256b692dbd9 (diff) | |
download | tangerine-wallet-browser-0b13429daf00ddd5bdf2705c7a95d7a9d5792f54.tar tangerine-wallet-browser-0b13429daf00ddd5bdf2705c7a95d7a9d5792f54.tar.gz tangerine-wallet-browser-0b13429daf00ddd5bdf2705c7a95d7a9d5792f54.tar.bz2 tangerine-wallet-browser-0b13429daf00ddd5bdf2705c7a95d7a9d5792f54.tar.lz tangerine-wallet-browser-0b13429daf00ddd5bdf2705c7a95d7a9d5792f54.tar.xz tangerine-wallet-browser-0b13429daf00ddd5bdf2705c7a95d7a9d5792f54.tar.zst tangerine-wallet-browser-0b13429daf00ddd5bdf2705c7a95d7a9d5792f54.zip |
Lint tests
Diffstat (limited to 'test/lib')
-rw-r--r-- | test/lib/mock-config-manager.js | 8 | ||||
-rw-r--r-- | test/lib/mock-encryptor.js | 12 | ||||
-rw-r--r-- | test/lib/mock-simple-keychain.js | 14 |
3 files changed, 17 insertions, 17 deletions
diff --git a/test/lib/mock-config-manager.js b/test/lib/mock-config-manager.js index 72be86ed1..3238d3501 100644 --- a/test/lib/mock-config-manager.js +++ b/test/lib/mock-config-manager.js @@ -2,9 +2,9 @@ const ObservableStore = require('obs-store') const clone = require('clone') const ConfigManager = require('../../app/scripts/lib/config-manager') const firstTimeState = require('../../app/scripts/first-time-state') -const STORAGE_KEY = 'metamask-config' +// const STORAGE_KEY = 'metamask-config' -module.exports = function() { - let store = new ObservableStore(clone(firstTimeState)) +module.exports = function () { + const store = new ObservableStore(clone(firstTimeState)) return new ConfigManager({ store }) -}
\ No newline at end of file +} diff --git a/test/lib/mock-encryptor.js b/test/lib/mock-encryptor.js index 09bbf7ad5..cdf13c507 100644 --- a/test/lib/mock-encryptor.js +++ b/test/lib/mock-encryptor.js @@ -4,28 +4,28 @@ let cacheVal module.exports = { - encrypt(password, dataObj) { + encrypt (password, dataObj) { cacheVal = dataObj return Promise.resolve(mockHex) }, - decrypt(password, text) { + decrypt (password, text) { return Promise.resolve(cacheVal || {}) }, - encryptWithKey(key, dataObj) { + encryptWithKey (key, dataObj) { return this.encrypt(key, dataObj) }, - decryptWithKey(key, text) { + decryptWithKey (key, text) { return this.decrypt(key, text) }, - keyFromPassword(password) { + keyFromPassword (password) { return Promise.resolve(mockKey) }, - generateSalt() { + generateSalt () { return 'WHADDASALT!' }, diff --git a/test/lib/mock-simple-keychain.js b/test/lib/mock-simple-keychain.js index 615b3e537..d3addc3e8 100644 --- a/test/lib/mock-simple-keychain.js +++ b/test/lib/mock-simple-keychain.js @@ -6,32 +6,32 @@ const type = 'Simple Key Pair' module.exports = class MockSimpleKeychain { - static type() { return type } + static type () { return type } - constructor(opts) { + constructor (opts) { this.type = type this.opts = opts || {} this.wallets = [] } - serialize() { + serialize () { return [ fakeWallet.privKey ] } - deserialize(data) { + deserialize (data) { if (!Array.isArray(data)) { throw new Error('Simple keychain deserialize requires a privKey array.') } this.wallets = [ fakeWallet ] } - addAccounts(n = 1) { - for(var i = 0; i < n; i++) { + addAccounts (n = 1) { + for (var i = 0; i < n; i++) { this.wallets.push(fakeWallet) } } - getAccounts() { + getAccounts () { return this.wallets.map(w => w.address) } |