prioritizer
Version:
Method to prioritize a list with persistence
17 lines (15 loc) • 400 B
JavaScript
const {defineParameterType} = require('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'
})