eth-gas-reporter
Advanced tools
Comparing version 0.0.14 to 0.0.15
## Changelog: eth-gas-reporter | ||
0.0.14 / 2017-11-30 | ||
=================== | ||
* Fix bug that caused the error report at the end of test run not to be printed. | ||
0.0.13 / 2017-11-15 | ||
@@ -4,0 +9,0 @@ =================== |
@@ -5,3 +5,3 @@ /** | ||
const colors = require('colors') | ||
const colors = require('colors/safe') | ||
const _ = require('lodash') | ||
@@ -76,6 +76,6 @@ const path = require('path') | ||
stats.average = Math.round(total / data.gasData.length) | ||
stats.cost = (ethPrice && gasPrice) ? gasToCost(stats.average, ethPrice, gasPrice) : '-'.grey | ||
stats.cost = (ethPrice && gasPrice) ? gasToCost(stats.average, ethPrice, gasPrice) : colors.grey('-') | ||
} else { | ||
stats.average = '-'.grey | ||
stats.cost = '-'.grey | ||
stats.average = colors.grey('-') | ||
stats.cost = colors.grey('-') | ||
} | ||
@@ -88,9 +88,9 @@ | ||
const uniform = (stats.min === stats.max) | ||
stats.min = (uniform) ? '-' : stats.min.toString().cyan | ||
stats.max = (uniform) ? '-' : stats.max.toString().red | ||
stats.min = (uniform) ? '-' : colors.cyan(stats.min.toString()) | ||
stats.max = (uniform) ? '-' : colors.red(stats.max.toString()) | ||
stats.numberOfCalls = data.numberOfCalls.toString().grey | ||
stats.numberOfCalls = colors.grey(data.numberOfCalls.toString()) | ||
const section = [] | ||
section.push(data.contract.grey) | ||
section.push(colors.grey(data.contract)) | ||
section.push(data.method) | ||
@@ -101,3 +101,3 @@ section.push({hAlign: 'right', content: stats.min}) | ||
section.push({hAlign: 'right', content: stats.numberOfCalls}) | ||
section.push({hAlign: 'right', content: stats.cost.toString().green}) | ||
section.push({hAlign: 'right', content: colors.green(stats.cost.toString())}) | ||
@@ -118,3 +118,3 @@ methodRows.push(section) | ||
stats.percent = gasToPercentOfLimit(stats.average) | ||
stats.cost = (ethPrice && gasPrice) ? gasToCost(stats.average, ethPrice, gasPrice) : '-'.grey | ||
stats.cost = (ethPrice && gasPrice) ? gasToCost(stats.average, ethPrice, gasPrice) : colors.grey('-') | ||
@@ -126,4 +126,4 @@ const sortedData = contract.gasData.sort((a, b) => a - b) | ||
const uniform = (stats.min === stats.max) | ||
stats.min = (uniform) ? '-' : stats.min.toString().cyan | ||
stats.max = (uniform) ? '-' : stats.max.toString().red | ||
stats.min = (uniform) ? '-' : colors.cyan(stats.min.toString()) | ||
stats.max = (uniform) ? '-' : colors.red(stats.max.toString()) | ||
@@ -135,4 +135,4 @@ const section = [] | ||
section.push({hAlign: 'right', content: stats.average}) | ||
section.push({hAlign: 'right', content: `${stats.percent} %`.grey}) | ||
section.push({hAlign: 'right', content: stats.cost.toString().green}) | ||
section.push({hAlign: 'right', content: colors.grey(`${stats.percent} %`)}) | ||
section.push({hAlign: 'right', content: colors.green(stats.cost.toString())}) | ||
@@ -154,4 +154,4 @@ deployRows.push(section) | ||
let title = [ | ||
{hAlign: 'center', colSpan: 5, content: 'Gas'.green.bold}, | ||
{hAlign: 'center', colSpan: 2, content: `Block limit: ${blockLimit} gas`.grey } | ||
{hAlign: 'center', colSpan: 5, content: colors.green.bold('Gas')}, | ||
{hAlign: 'center', colSpan: 2, content: colors.grey(`Block limit: ${blockLimit} gas`)} | ||
] | ||
@@ -165,18 +165,18 @@ | ||
methodSubtitle = [ | ||
{hAlign: 'left', colSpan: 2, content: 'Methods'.green.bold}, | ||
{hAlign: 'center', colSpan: 3, content: `${gwei} gwei/gas`.grey}, | ||
{hAlign: 'center', colSpan: 2, content: `${rate} ${currency.toLowerCase()}/eth`.red} | ||
{hAlign: 'left', colSpan: 2, content: colors.green.bold('Methods')}, | ||
{hAlign: 'center', colSpan: 3, content: colors.grey(`${gwei} gwei/gas`)}, | ||
{hAlign: 'center', colSpan: 2, content: colors.red(`${rate} ${currency.toLowerCase()}/eth`)} | ||
] | ||
} else { | ||
methodSubtitle = [{hAlign: 'left', colSpan: 7, content: 'Methods'.green.bold}] | ||
methodSubtitle = [{hAlign: 'left', colSpan: 7, content: colors.green.bold('Methods')}] | ||
} | ||
const header = [ | ||
'Contract'.bold, | ||
'Method'.bold, | ||
'Min'.green, | ||
'Max'.green, | ||
'Avg'.green, | ||
'# calls'.bold, | ||
`${currency.toLowerCase()} (avg)`.bold | ||
colors.bold('Contract'), | ||
colors.bold('Method'), | ||
colors.green('Min'), | ||
colors.green('Max'), | ||
colors.green('Avg'), | ||
colors.bold('# calls'), | ||
colors.bold(`${currency.toLowerCase()} (avg)`) | ||
] | ||
@@ -199,5 +199,5 @@ | ||
const deploymentsSubtitle = [ | ||
{hAlign: 'left', colSpan: 2, content: 'Deployments'.green.bold}, | ||
{hAlign: 'left', colSpan: 2, content: colors.green.bold('Deployments')}, | ||
{hAlign: 'right', colSpan: 3, content: '' }, | ||
{hAlign: 'left', colSpan: 1, content: `% of limit`.bold} | ||
{hAlign: 'left', colSpan: 1, content: colors.bold(`% of limit`)} | ||
] | ||
@@ -204,0 +204,0 @@ table.push(deploymentsSubtitle) |
{ | ||
"name": "eth-gas-reporter", | ||
"version": "0.0.13", | ||
"version": "0.0.14", | ||
"description": "Mocha reporter which shows gas used per unit test.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
{ | ||
"name": "eth-gas-reporter", | ||
"version": "0.0.14", | ||
"version": "0.0.15", | ||
"description": "Mocha reporter which shows gas used per unit test.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
34458