11import _ from 'lodash'
2+ import path from 'path'
23import parse from '@cucumber/tag-expressions'
34import { getGherkinScenarioLocationMap } from './formatter/helpers/gherkin_document_parser'
45import { doesHaveValue , doesNotHaveValue } from './value_checker'
@@ -56,23 +57,20 @@ export class PickleLineFilter {
5657
5758 constructor ( cwd : string , featurePaths : string [ ] = [ ] ) {
5859 this . featureUriToLinesMapping = this . getFeatureUriToLinesMapping ( {
59- cwd,
6060 featurePaths,
6161 } )
6262 }
6363
6464 getFeatureUriToLinesMapping ( {
65- cwd,
6665 featurePaths,
6766 } : {
68- cwd : string
6967 featurePaths : string [ ]
7068 } ) : Record < string , number [ ] > {
7169 const mapping : Record < string , number [ ] > = { }
7270 featurePaths . forEach ( ( featurePath ) => {
7371 const match = FEATURE_LINENUM_REGEXP . exec ( featurePath )
7472 if ( doesHaveValue ( match ) ) {
75- const uri = match [ 1 ]
73+ const uri = path . normalize ( match [ 1 ] )
7674 const linesExpression = match [ 2 ]
7775 if ( doesHaveValue ( linesExpression ) ) {
7876 if ( doesNotHaveValue ( mapping [ uri ] ) ) {
@@ -91,7 +89,8 @@ export class PickleLineFilter {
9189 }
9290
9391 matchesAnyLine ( { gherkinDocument, pickle } : IMatchesAnyLineRequest ) : boolean {
94- const linesToMatch = this . featureUriToLinesMapping [ pickle . uri ]
92+ const uri = path . normalize ( pickle . uri )
93+ const linesToMatch = this . featureUriToLinesMapping [ uri ]
9594 if ( doesHaveValue ( linesToMatch ) ) {
9695 const gherkinScenarioLocationMap = getGherkinScenarioLocationMap (
9796 gherkinDocument
0 commit comments