Skip to content

Commit

Permalink
- adds "source-map-support" dependency
Browse files Browse the repository at this point in the history
- progress towards fixing bug for paths with parentheses Cucumber's own features fail when parent directory contains parentheses cucumber#1735
- gets accurate line numbers for Error stacks in typescript

Co-authored-by: Blaise Pabon <blaise@gmail.com>
Co-authored-by: Matt Wynne <matt@mattwynne.net>
  • Loading branch information
3 people committed Oct 22, 2021
1 parent a7750b9 commit d1217f0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 111 deletions.
103 changes: 2 additions & 101 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@
"node": ">=12"
},
"dependencies": {
"@cspotcode/source-map-support": "^0.6.1",
"@cucumber/create-meta": "6.0.1",
"@cucumber/cucumber-expressions": "12.1.2",
"@cucumber/gherkin": "20.0.1",
Expand Down
12 changes: 2 additions & 10 deletions src/support_code_library_builder/get_definition_line_and_uri.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import path from 'path'
import { wrapCallSite } from '@cspotcode/source-map-support'
import stackChain from 'stack-chain'
import { isFileNameInCucumber } from '../stack_trace_filter'
import { doesHaveValue, valueOrDefault } from '../value_checker'
Expand All @@ -12,16 +13,7 @@ export function getDefinitionLineAndUri(
let line: number
let uri: string
try {
console.log(new Error().stack.split("\n").slice(1).map(
(line: String) => line.match(/(\/.*):(\d+):\d+/).slice(1,3)
))
const stackframes = stackChain.callSite()
/*console.log(
stackframes.map((frame: CallSite) => [
frame.getLineNumber(),
frame.getFileName(),
])
)*/
const stackframes: CallSite[] = stackChain.callSite().map(wrapCallSite)
const stackframe = stackframes.find(
(frame: CallSite) =>
frame.getFileName() !== __filename && !isExcluded(frame.getFileName())
Expand Down

0 comments on commit d1217f0

Please sign in to comment.