UNPKG

auto-tdd

Version:

Automated development with TDD

17 lines (15 loc) 410 B
const {defineParameterType} = require('@cucumber/cucumber') defineParameterType({ regexp: /increment|decrement/, transformer: function (operationId) { switch (operationId) { case 'increment': return this.incrementBy case 'decrement': return this.decrementBy default: throw new Error(`Operation ${operationId} not supported`) } }, name: 'operation' })