Add custom message to Jest expects
Overall
score
99%
Build a utility that measures the performance characteristics of an assertion enhancement library when used with and without custom messages.
@generates
Create a benchmarking utility that measures execution time for assertions in two scenarios:
The utility should:
performance.now() or similar high-resolution timing for accurate measurements((enhancedTime - baselineTime) / baselineTime) * 100/**
* Runs performance benchmarks comparing assertions with and without custom messages
* @param {number} iterations - Number of assertions to execute in each scenario (default: 10000)
* @returns {Object} Benchmark results
* @returns {number} return.baselineTime - Execution time for assertions without custom messages (ms)
* @returns {number} return.enhancedTime - Execution time for assertions with custom messages (ms)
* @returns {number} return.overheadPercent - Performance overhead percentage
*/
function runBenchmark(iterations = 10000) {
// IMPLEMENTATION HERE
}
module.exports = { runBenchmark };Provides custom error messages for Jest assertions.
@satisfied-by
Install with Tessl CLI
npx tessl i tessl/npm-jest-expect-messagedocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10