@@ -1086,56 +1086,56 @@ export default function createTests(
10861086
10871087 const testStepIds : TestStepIds = new Map ( ) ;
10881088
1089- const testCases : messages . TestCase [ ] = pickles
1090- . filter ( ( pickle ) => {
1091- return ! omitFiltered || ! shouldSkipPickle ( testFilter , pickle ) ;
1092- } )
1093- . map ( ( pickle ) => {
1094- const tags = collectTagNames ( pickle . tags ) ;
1095- const beforeHooks = registry . resolveBeforeHooks ( tags ) ;
1096- const afterHooks = registry . resolveAfterHooks ( tags ) ;
1097-
1098- const hooksToStep = ( hook : ICaseHook ) : messages . TestStep => {
1099- return {
1100- id : createTestStepId ( {
1101- testStepIds,
1102- newId,
1103- pickleId : pickle . id ,
1104- hookIdOrPickleStepId : hook . id ,
1105- } ) ,
1106- hookId : hook . id ,
1107- } ;
1108- } ;
1089+ const includedPickles = pickles . filter ( ( pickle ) => {
1090+ return ! omitFiltered || ! shouldSkipPickle ( testFilter , pickle ) ;
1091+ } ) ;
11091092
1110- const pickleStepToTestStep = (
1111- pickleStep : messages . PickleStep
1112- ) : messages . TestStep => {
1113- const stepDefinitionIds = registry
1114- . getMatchingStepDefinitions ( pickleStep . text )
1115- . map ( ( stepDefinition ) => stepDefinition . id ) ;
1116-
1117- return {
1118- id : createTestStepId ( {
1119- testStepIds,
1120- newId,
1121- pickleId : pickle . id ,
1122- hookIdOrPickleStepId : pickleStep . id ,
1123- } ) ,
1124- pickleStepId : pickleStep . id ,
1125- stepDefinitionIds,
1126- } ;
1093+ const testCases : messages . TestCase [ ] = includedPickles . map ( ( pickle ) => {
1094+ const tags = collectTagNames ( pickle . tags ) ;
1095+ const beforeHooks = registry . resolveBeforeHooks ( tags ) ;
1096+ const afterHooks = registry . resolveAfterHooks ( tags ) ;
1097+
1098+ const hooksToStep = ( hook : ICaseHook ) : messages . TestStep => {
1099+ return {
1100+ id : createTestStepId ( {
1101+ testStepIds,
1102+ newId,
1103+ pickleId : pickle . id ,
1104+ hookIdOrPickleStepId : hook . id ,
1105+ } ) ,
1106+ hookId : hook . id ,
11271107 } ;
1108+ } ;
1109+
1110+ const pickleStepToTestStep = (
1111+ pickleStep : messages . PickleStep
1112+ ) : messages . TestStep => {
1113+ const stepDefinitionIds = registry
1114+ . getMatchingStepDefinitions ( pickleStep . text )
1115+ . map ( ( stepDefinition ) => stepDefinition . id ) ;
11281116
11291117 return {
1130- id : pickle . id ,
1131- pickleId : pickle . id ,
1132- testSteps : [
1133- ...beforeHooks . map ( hooksToStep ) ,
1134- ...pickle . steps . map ( pickleStepToTestStep ) ,
1135- ...afterHooks . map ( hooksToStep ) ,
1136- ] ,
1118+ id : createTestStepId ( {
1119+ testStepIds,
1120+ newId,
1121+ pickleId : pickle . id ,
1122+ hookIdOrPickleStepId : pickleStep . id ,
1123+ } ) ,
1124+ pickleStepId : pickleStep . id ,
1125+ stepDefinitionIds,
11371126 } ;
1138- } ) ;
1127+ } ;
1128+
1129+ return {
1130+ id : pickle . id ,
1131+ pickleId : pickle . id ,
1132+ testSteps : [
1133+ ...beforeHooks . map ( hooksToStep ) ,
1134+ ...pickle . steps . map ( pickleStepToTestStep ) ,
1135+ ...afterHooks . map ( hooksToStep ) ,
1136+ ] ,
1137+ } ;
1138+ } ) ;
11391139
11401140 const specEnvelopes : messages . Envelope [ ] = [ ] ;
11411141
@@ -1154,7 +1154,7 @@ export default function createTests(
11541154 gherkinDocument,
11551155 } ) ;
11561156
1157- for ( const pickle of pickles ) {
1157+ for ( const pickle of includedPickles ) {
11581158 specEnvelopes . push ( {
11591159 pickle,
11601160 } ) ;
0 commit comments