aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/app/controllers/metamask-controller-test.js
diff options
context:
space:
mode:
authorWhymarrh Whitby <whymarrh.whitby@gmail.com>2019-05-09 03:51:33 +0800
committerFrankie <frankie.diamond@gmail.com>2019-05-09 03:51:33 +0800
commit094e4cf555c698bfef50ca6679cd1e98f4ea9aa1 (patch)
treecd2b1df66e2a00cc7c24f2c09e28f28f10262a43 /test/unit/app/controllers/metamask-controller-test.js
parentef8a07c2ce2b1c5fc4ef18f48592b2e7da178c44 (diff)
downloadtangerine-wallet-browser-094e4cf555c698bfef50ca6679cd1e98f4ea9aa1.tar
tangerine-wallet-browser-094e4cf555c698bfef50ca6679cd1e98f4ea9aa1.tar.gz
tangerine-wallet-browser-094e4cf555c698bfef50ca6679cd1e98f4ea9aa1.tar.bz2
tangerine-wallet-browser-094e4cf555c698bfef50ca6679cd1e98f4ea9aa1.tar.lz
tangerine-wallet-browser-094e4cf555c698bfef50ca6679cd1e98f4ea9aa1.tar.xz
tangerine-wallet-browser-094e4cf555c698bfef50ca6679cd1e98f4ea9aa1.tar.zst
tangerine-wallet-browser-094e4cf555c698bfef50ca6679cd1e98f4ea9aa1.zip
Check for unused function arguments (#6583)
* eslint: Check for unused function arguments * eslint: Ignore unused '_' in argument list Also allow any number of '_' e.g., '__' or '___' which is to be used sparingly * Remove and rename unused arguments
Diffstat (limited to 'test/unit/app/controllers/metamask-controller-test.js')
-rw-r--r--test/unit/app/controllers/metamask-controller-test.js20
1 files changed, 10 insertions, 10 deletions
diff --git a/test/unit/app/controllers/metamask-controller-test.js b/test/unit/app/controllers/metamask-controller-test.js
index 1ed6a95fb..0a1a85d5e 100644
--- a/test/unit/app/controllers/metamask-controller-test.js
+++ b/test/unit/app/controllers/metamask-controller-test.js
@@ -49,7 +49,7 @@ describe('MetaMaskController', function () {
showUnapprovedTx: noop,
showUnconfirmedMessage: noop,
encryptor: {
- encrypt: function (password, object) {
+ encrypt: function (_, object) {
this.object = object
return Promise.resolve('mock-encrypted')
},
@@ -144,7 +144,7 @@ describe('MetaMaskController', function () {
sandbox.stub(metamaskController, 'getBalance')
metamaskController.getBalance.callsFake(() => { return Promise.resolve('0x0') })
- await metamaskController.createNewVaultAndRestore(password, TEST_SEED.slice(0, -1)).catch((e) => null)
+ await metamaskController.createNewVaultAndRestore(password, TEST_SEED.slice(0, -1)).catch(() => null)
await metamaskController.createNewVaultAndRestore(password, TEST_SEED)
assert(metamaskController.keyringController.createNewVaultAndRestore.calledTwice)
@@ -207,7 +207,7 @@ describe('MetaMaskController', function () {
const accounts = {}
const balance = '0x14ced5122ce0a000'
const ethQuery = new EthQuery()
- sinon.stub(ethQuery, 'getBalance').callsFake((account, callback) => {
+ sinon.stub(ethQuery, 'getBalance').callsFake((_, callback) => {
callback(undefined, balance)
})
@@ -295,7 +295,7 @@ describe('MetaMaskController', function () {
it('should add the Trezor Hardware keyring', async function () {
sinon.spy(metamaskController.keyringController, 'addNewKeyring')
- await metamaskController.connectHardware('trezor', 0).catch((e) => null)
+ await metamaskController.connectHardware('trezor', 0).catch(() => null)
const keyrings = await metamaskController.keyringController.getKeyringsByType(
'Trezor Hardware'
)
@@ -305,7 +305,7 @@ describe('MetaMaskController', function () {
it('should add the Ledger Hardware keyring', async function () {
sinon.spy(metamaskController.keyringController, 'addNewKeyring')
- await metamaskController.connectHardware('ledger', 0).catch((e) => null)
+ await metamaskController.connectHardware('ledger', 0).catch(() => null)
const keyrings = await metamaskController.keyringController.getKeyringsByType(
'Ledger Hardware'
)
@@ -325,7 +325,7 @@ describe('MetaMaskController', function () {
})
it('should be locked by default', async function () {
- await metamaskController.connectHardware('trezor', 0).catch((e) => null)
+ await metamaskController.connectHardware('trezor', 0).catch(() => null)
const status = await metamaskController.checkHardwareStatus('trezor')
assert.equal(status, false)
})
@@ -341,7 +341,7 @@ describe('MetaMaskController', function () {
})
it('should wipe all the keyring info', async function () {
- await metamaskController.connectHardware('trezor', 0).catch((e) => null)
+ await metamaskController.connectHardware('trezor', 0).catch(() => null)
await metamaskController.forgetDevice('trezor')
const keyrings = await metamaskController.keyringController.getKeyringsByType(
'Trezor Hardware'
@@ -376,7 +376,7 @@ describe('MetaMaskController', function () {
sinon.spy(metamaskController.preferencesController, 'setAddresses')
sinon.spy(metamaskController.preferencesController, 'setSelectedAddress')
sinon.spy(metamaskController.preferencesController, 'setAccountLabel')
- await metamaskController.connectHardware('trezor', 0, `m/44/0'/0'`).catch((e) => null)
+ await metamaskController.connectHardware('trezor', 0, `m/44/0'/0'`).catch(() => null)
await metamaskController.unlockHardwareWalletAccount(accountToUnlock, 'trezor', `m/44/0'/0'`)
})
@@ -757,7 +757,7 @@ describe('MetaMaskController', function () {
const { promise, resolve } = deferredPromise()
- streamTest = createThoughStream((chunk, enc, cb) => {
+ streamTest = createThoughStream((chunk, _, cb) => {
if (chunk.name !== 'phishing') return cb()
assert.equal(chunk.data.hostname, phishingUrl)
resolve()
@@ -777,7 +777,7 @@ describe('MetaMaskController', function () {
})
it('sets up controller dnode api for trusted communication', function (done) {
- streamTest = createThoughStream((chunk, enc, cb) => {
+ streamTest = createThoughStream((chunk, _, cb) => {
assert.equal(chunk.name, 'controller')
cb()
done()