Skip to content

Commit

Permalink
Merge pull request jest-community#270 from stephtr/master
Browse files Browse the repository at this point in the history
Fix regex for detecting jest.js
  • Loading branch information
orta committed Feb 22, 2018
2 parents 0d9e1f4 + b91451d commit fbcbde5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ Bug-fixes within the same version aren't needed

## Master

* Fixes debugging of tasks on Windows (bug introduced in 2.6.2) - stephtr

### 2.6.3

* Even better detection logic for projects created by `create-react-app` - stephtr
Expand Down
8 changes: 7 additions & 1 deletion src/JestExt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ export class JestExt {

case '#!/bin/sh': {
const line = lines[8]
const match = /^\s*"[^"]+"\s+"$basedir\/([^"]+)"/.exec(line)
const match = /^\s*"[^"]+"\s+"\$basedir\/([^"]+)"/.exec(line)
if (match) {
return path.join(path.dirname(jest), match[1])
}
Expand All @@ -512,6 +512,12 @@ export class JestExt {

break
}

case 'npm test --':
case 'npm.cmd test --': {
vscode.window.showErrorMessage('Debugging of tasks is currently only available when directly running jest!')
return undefined
}
}

vscode.window.showErrorMessage('Cannot find jest.js file!')
Expand Down

0 comments on commit fbcbde5

Please sign in to comment.