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/unit/config-manager-test.js | |
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/unit/config-manager-test.js')
-rw-r--r-- | test/unit/config-manager-test.js | 45 |
1 files changed, 22 insertions, 23 deletions
diff --git a/test/unit/config-manager-test.js b/test/unit/config-manager-test.js index 05324e741..eeb193e91 100644 --- a/test/unit/config-manager-test.js +++ b/test/unit/config-manager-test.js @@ -2,26 +2,25 @@ global.fetch = global.fetch || require('isomorphic-fetch') const assert = require('assert') -const extend = require('xtend') -const rp = require('request-promise') -const nock = require('nock') +// const extend = require('xtend') +// const rp = require('request-promise') +// const nock = require('nock') const configManagerGen = require('../lib/mock-config-manager') -describe('config-manager', function() { +describe('config-manager', function () { var configManager - beforeEach(function() { + beforeEach(function () { configManager = configManagerGen() }) - describe('#setConfig', function() { - + describe('#setConfig', function () { it('should set the config key', function () { var testConfig = { provider: { type: 'rpc', - rpcTarget: 'foobar' - } + rpcTarget: 'foobar', + }, } configManager.setConfig(testConfig) var result = configManager.getData() @@ -30,17 +29,17 @@ describe('config-manager', function() { assert.equal(result.config.provider.rpcTarget, testConfig.provider.rpcTarget) }) - it('setting wallet should not overwrite config', function() { + it('setting wallet should not overwrite config', function () { var testConfig = { provider: { type: 'rpc', - rpcTarget: 'foobar' + rpcTarget: 'foobar', }, } configManager.setConfig(testConfig) var testWallet = { - name: 'this is my fake wallet' + name: 'this is my fake wallet', } configManager.setWallet(testWallet) @@ -58,13 +57,13 @@ describe('config-manager', function() { }) }) - describe('wallet nicknames', function() { - it('should return null when no nicknames are saved', function() { + describe('wallet nicknames', function () { + it('should return null when no nicknames are saved', function () { var nick = configManager.nicknameForWallet('0x0') assert.equal(nick, null, 'no nickname returned') }) - it('should persist nicknames', function() { + it('should persist nicknames', function () { var account = '0x0' var nick1 = 'foo' var nick2 = 'bar' @@ -79,8 +78,8 @@ describe('config-manager', function() { }) }) - describe('rpc manipulations', function() { - it('changing rpc should return a different rpc', function() { + describe('rpc manipulations', function () { + it('changing rpc should return a different rpc', function () { var firstRpc = 'first' var secondRpc = 'second' @@ -94,21 +93,21 @@ describe('config-manager', function() { }) }) - describe('transactions', function() { - beforeEach(function() { + describe('transactions', function () { + beforeEach(function () { configManager.setTxList([]) }) - describe('#getTxList', function() { - it('when new should return empty array', function() { + describe('#getTxList', function () { + it('when new should return empty array', function () { var result = configManager.getTxList() assert.ok(Array.isArray(result)) assert.equal(result.length, 0) }) }) - describe('#setTxList', function() { - it('saves the submitted data to the tx list', function() { + describe('#setTxList', function () { + it('saves the submitted data to the tx list', function () { var target = [{ foo: 'bar' }] configManager.setTxList(target) var result = configManager.getTxList() |