From 201b082627f7ce40e868f39f4f19d601276be997 Mon Sep 17 00:00:00 2001 From: Charlie Rudolph Date: Thu, 9 Mar 2017 17:21:24 -0800 Subject: [PATCH] parameter type: duplicate regex (#780) --- features/parameter_types.feature | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/features/parameter_types.feature b/features/parameter_types.feature index a9b8cb315..a6240251d 100644 --- a/features/parameter_types.feature +++ b/features/parameter_types.feature @@ -133,3 +133,23 @@ Feature: Parameter types """ transform error """ + + Scenario: duplicate capture group regex + Given a file named "features/support/my_parameter_types.js" with: + """ + import {defineSupportCode} from 'cucumber' + + defineSupportCode(({defineParameterType, When}) => { + defineParameterType({ + regexp: /"[^"]+"/, + transformer: JSON.parse, + typeName: 'stringInDoubleQuotes2' + }) + }) + """ + When I run cucumber.js with `-f progress` + Then the output contains the text: + """ + There is already a parameter with regexp "[^"]+" + """ + And it fails