diff --git a/benchmark_results/curr.json b/benchmark_results/curr.json index 0e03da50..0d9299c6 100644 --- a/benchmark_results/curr.json +++ b/benchmark_results/curr.json @@ -10,17 +10,17 @@ "results": [ { "unit": "ms", - "value": 701, + "value": 100, "name": "latency" }, { "unit": "op/s", - "value": 123, + "value": 100, "name": "metric2" }, { "unit": "%", - "value": 456, + "value": 100, "name": "metric3" } ] diff --git a/dist/index.js b/dist/index.js index edb110d1..072f19e1 100644 --- a/dist/index.js +++ b/dist/index.js @@ -9924,14 +9924,14 @@ module.exports.createCommentBodyForComparisonWithPrevBench = function ( if (prev) { if (comparisonMode === 'bigger') { - if (comparisonMargin === -1) { + if (comparisonMargin === '-1') { currentBetter = currentMetric.value > prev.value } else { const lowerLimit = prev.value * (1 + comparisonMargin / 100) currentBetter = currentMetric.value >= lowerLimit } } else if (comparisonMode === 'smaller') { - if (comparisonMargin === -1) { + if (comparisonMargin === '-1') { console.log('Comparing smaller with margin -1') currentBetter = currentMetric.value < prev.value console.log('Current better: ' + currentBetter) @@ -10089,7 +10089,7 @@ module.exports.createCommentBodyForComparisonWithThreshold = function ( if (comparisonMode === 'bigger') { // If comparisonMargin is -1, we look for a strictly bigger value - if (comparisonMargin === -1) { + if (comparisonMargin === '-1') { meetsThreshold = currentMetric.value > currentThreshold } // otherwise, we look for a value that is at least comparisonMargin% bigger @@ -10098,8 +10098,8 @@ module.exports.createCommentBodyForComparisonWithThreshold = function ( meetsThreshold = currentMetric.value >= lowerLimit } } else if (comparisonMode === 'smaller') { - // If comparisonMargin is -1, we look for a strictly smaller value - if (comparisonMargin === -1) { + // If comparisonMargin is "-1", we look for a strictly smaller value + if (comparisonMargin === '-1') { meetsThreshold = currentMetric.value < currentThreshold } // otherwise, we look for a value that is at least comparisonMargin% smaller diff --git a/src/comment.js b/src/comment.js index 5769b715..761fdd1e 100644 --- a/src/comment.js +++ b/src/comment.js @@ -105,14 +105,14 @@ module.exports.createCommentBodyForComparisonWithPrevBench = function ( if (prev) { if (comparisonMode === 'bigger') { - if (comparisonMargin === -1) { + if (comparisonMargin === '-1') { currentBetter = currentMetric.value > prev.value } else { const lowerLimit = prev.value * (1 + comparisonMargin / 100) currentBetter = currentMetric.value >= lowerLimit } } else if (comparisonMode === 'smaller') { - if (comparisonMargin === -1) { + if (comparisonMargin === '-1') { console.log('Comparing smaller with margin -1') currentBetter = currentMetric.value < prev.value console.log('Current better: ' + currentBetter) @@ -270,7 +270,7 @@ module.exports.createCommentBodyForComparisonWithThreshold = function ( if (comparisonMode === 'bigger') { // If comparisonMargin is -1, we look for a strictly bigger value - if (comparisonMargin === -1) { + if (comparisonMargin === '-1') { meetsThreshold = currentMetric.value > currentThreshold } // otherwise, we look for a value that is at least comparisonMargin% bigger @@ -279,8 +279,8 @@ module.exports.createCommentBodyForComparisonWithThreshold = function ( meetsThreshold = currentMetric.value >= lowerLimit } } else if (comparisonMode === 'smaller') { - // If comparisonMargin is -1, we look for a strictly smaller value - if (comparisonMargin === -1) { + // If comparisonMargin is "-1", we look for a strictly smaller value + if (comparisonMargin === '-1') { meetsThreshold = currentMetric.value < currentThreshold } // otherwise, we look for a value that is at least comparisonMargin% smaller