mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Fix mocha/max-top-level-suites issues (#9699)
Refs #9663 This change enables `mocha/max-top-level-suites` and fixes the issues raised by the rule.
This commit is contained in:
parent
c47d93d9bc
commit
80e2a4496e
@ -92,7 +92,6 @@ module.exports = {
|
||||
'node/no-sync': 'off',
|
||||
'node/no-unpublished-import': 'off',
|
||||
'node/no-unpublished-require': 'off',
|
||||
'mocha/max-top-level-suites': 'off',
|
||||
},
|
||||
|
||||
overrides: [{
|
||||
|
@ -2,40 +2,42 @@ import assert from 'assert'
|
||||
import { ETH } from '../constants/common'
|
||||
import * as utils from './conversions.util'
|
||||
|
||||
describe('getWeiHexFromDecimalValue', function () {
|
||||
it('should correctly convert 0 in ETH', function () {
|
||||
const weiValue = utils.getWeiHexFromDecimalValue({
|
||||
value: '0',
|
||||
fromCurrency: ETH,
|
||||
fromDenomination: ETH,
|
||||
describe('conversion utils', function () {
|
||||
describe('getWeiHexFromDecimalValue', function () {
|
||||
it('should correctly convert 0 in ETH', function () {
|
||||
const weiValue = utils.getWeiHexFromDecimalValue({
|
||||
value: '0',
|
||||
fromCurrency: ETH,
|
||||
fromDenomination: ETH,
|
||||
})
|
||||
assert.equal(weiValue, '0')
|
||||
})
|
||||
})
|
||||
|
||||
describe('decETHToDecWEI', function () {
|
||||
it('should correctly convert 1 ETH to WEI', function () {
|
||||
const weiValue = utils.decETHToDecWEI('1')
|
||||
assert.equal(weiValue, '1000000000000000000')
|
||||
})
|
||||
|
||||
it('should correctly convert 0.000000000000000001 ETH to WEI', function () {
|
||||
const weiValue = utils.decETHToDecWEI('0.000000000000000001')
|
||||
assert.equal(weiValue, '1')
|
||||
})
|
||||
|
||||
it('should correctly convert 1000000.000000000000000001 ETH to WEI', function () {
|
||||
const weiValue = utils.decETHToDecWEI('1000000.000000000000000001')
|
||||
assert.equal(weiValue, '1000000000000000000000001')
|
||||
})
|
||||
|
||||
it('should correctly convert 9876.543210 ETH to WEI', function () {
|
||||
const weiValue = utils.decETHToDecWEI('9876.543210')
|
||||
assert.equal(weiValue, '9876543210000000000000')
|
||||
})
|
||||
|
||||
it('should correctly convert 1.0000000000000000 ETH to WEI', function () {
|
||||
const weiValue = utils.decETHToDecWEI('1.0000000000000000')
|
||||
assert.equal(weiValue, '1000000000000000000')
|
||||
})
|
||||
assert.equal(weiValue, '0')
|
||||
})
|
||||
})
|
||||
|
||||
describe('decETHToDecWEI', function () {
|
||||
it('should correctly convert 1 ETH to WEI', function () {
|
||||
const weiValue = utils.decETHToDecWEI('1')
|
||||
assert.equal(weiValue, '1000000000000000000')
|
||||
})
|
||||
|
||||
it('should correctly convert 0.000000000000000001 ETH to WEI', function () {
|
||||
const weiValue = utils.decETHToDecWEI('0.000000000000000001')
|
||||
assert.equal(weiValue, '1')
|
||||
})
|
||||
|
||||
it('should correctly convert 1000000.000000000000000001 ETH to WEI', function () {
|
||||
const weiValue = utils.decETHToDecWEI('1000000.000000000000000001')
|
||||
assert.equal(weiValue, '1000000000000000000000001')
|
||||
})
|
||||
|
||||
it('should correctly convert 9876.543210 ETH to WEI', function () {
|
||||
const weiValue = utils.decETHToDecWEI('9876.543210')
|
||||
assert.equal(weiValue, '9876543210000000000000')
|
||||
})
|
||||
|
||||
it('should correctly convert 1.0000000000000000 ETH to WEI', function () {
|
||||
const weiValue = utils.decETHToDecWEI('1.0000000000000000')
|
||||
assert.equal(weiValue, '1000000000000000000')
|
||||
})
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user