Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix regex for detecting jest.js #270

Merged
merged 4 commits into from
Feb 22, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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