How to use the benny.add.skip function in benny

To help you get started, we’ve selected a few benny examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github caderek / arrows / packages / multimethod / benchmark / suites / multimethod-execution.ts View on Github external
import { add, complete, cycle, save, suite } from 'benny'
import { method, multi } from '../../src'
import {
  createNMethodsWithComplexCaseVal,
  createNMethodsWithSimpleFunFun,
  createNMethodsWithSimpleValVal,
} from './helpers'

const { version } = require('../../package.json')

export default suite(
  'Multimethod execution',

  add.skip('Execute identity function for reference', () => {
    const fn = (x) => x

    return () => fn('foo')
  }),

  add('Execute multimethod with default method as value only', () => {
    const fn = multi(method('default'))

    return () => fn('foo')
  }),

  add(
    'Execute multimethod with one simple val/val method - last matching',
    () => {
      const methods = createNMethodsWithSimpleValVal(1)
      const fn = multi(...methods)

benny

A dead simple benchmarking framework

ISC
Latest version published 3 years ago

Package Health Score

53 / 100
Full package analysis