Skip to content

Commit

Permalink
Merge pull request #473 from jest-community/beta
Browse files Browse the repository at this point in the history
merge beta (3.0.1) back to `master`
  • Loading branch information
connectdotz committed Jun 25, 2019
2 parents 6718f84 + 1d49bba commit 745e603
Show file tree
Hide file tree
Showing 64 changed files with 6,088 additions and 2,681 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
_jest-editor/
.vscode/symbols.json
coverage/
/coverage/
integrations/create-react-example/node_modules
node_modules/
out/

**/.DS_Store
*.vsix
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: node_js
node_js:
- "6"
- "8"
script:
- yarn ci
- cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js
Expand Down
56 changes: 29 additions & 27 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,31 @@
// A launch configuration that compiles the extension and then opens it inside a new window
{
"version": "0.1.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Debug Tests",
"program": "${workspaceRoot}/node_modules/jest/bin/jest.js",
"cwd": "${workspaceRoot}",
"args": [
"--i",
"--config",
"jest.json"
]
},
{
"name": "Launch Extension",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": ["--extensionDevelopmentPath=${workspaceRoot}" ],
"stopOnEntry": false,
"sourceMaps": true,
"outDir": "${workspaceRoot}/out/src",
"preLaunchTask": "npm"
}
]
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Debug Tests",
"program": "${workspaceRoot}/node_modules/jest/bin/jest.js",
"cwd": "${workspaceRoot}",
"args": ["--i", "--config", "jest.json"]
},
{
"name": "Launch Extension (development)",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": ["--extensionDevelopmentPath=${workspaceFolder}"],
"outFiles": ["${workspaceFolder}/out/**/*.js"],
"preLaunchTask": "watch"
},
{
"name": "Launch Extension (production)",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": ["--extensionDevelopmentPath=${workspaceFolder}"],
"outFiles": ["${workspaceFolder}/out/**/*.js"],
"preLaunchTask": "npm: compile"
}
]
}
1 change: 0 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"typescript.tsdk": "./node_modules/typescript/lib",
"eslint.enable": false,
"tslint.autoFixOnSave": true,
"jest.pathToConfig": "./jest.json",
"prettier.semi": false,
"prettier.printWidth": 120,
"prettier.trailingComma": "es5",
Expand Down
57 changes: 28 additions & 29 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,29 @@
// Available variables which can be used inside of strings.
// ${workspaceRoot}: the root folder of the team
// ${file}: the current opened file
// ${fileBasename}: the current opened file's basename
// ${fileDirname}: the current opened file's dirname
// ${fileExtname}: the current opened file's extension
// ${cwd}: the current working directory of the spawned process

// A task runner that calls a custom npm script that compiles the extension.
{
"version": "0.1.0",

// we want to run npm
"command": "npm",

// the command is a shell script
"isShellCommand": true,

// show the output window only if unrecognized errors occur.
"showOutput": "silent",

// we run the custom script "compile" as defined in package.json
"args": ["run", "compile", "--loglevel", "silent"],

// The tsc compiler is started in watching mode
"isWatching": true,

// use the standard tsc in watch mode problem matcher to find compile problems in the output.
"problemMatcher": "$tsc-watch"
}
"version": "2.0.0",
"tasks": [
{
"label": "watch",
"type": "npm",
"script": "watch",
"isBackground": true,
"problemMatcher": [
{
"owner": "custom",
"pattern": [
{
"regexp": "^PATTERN WON'T MATCH, BUT NEEDED TO BE A VALID PROBLEM MATCHER$",
"file": 1,
"location": 2,
"message": 3
}
],
"background": {
"activeOnStart": true,
"beginsPattern": "^Compilation\\s+starting",
"endsPattern": "^Compilation\\s+finished"
}
}
]
}
]
}
6 changes: 5 additions & 1 deletion .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ src/**
**/*.map
.gitignore
tsconfig.json
vsc-extension-quickstart.md
integrations/**
**/__mocks__/**
**/tests/**
Expand All @@ -17,3 +16,8 @@ tslint.json
yarn.lock
yarn-error.log
scripts/
coverage
.github/**
images/**
!images/vscode-jest.png
webpack.config.js
24 changes: 22 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,30 @@ Bug-fixes within the same version aren't needed
## Master
* Your message here - name
-->

### 3.0.1

* use webpack for compilation, resulting in a much smaller extension size - stephtr

* fix security vulnerability for dependencies flagged by github - stephtr

### 3.0.0
* Support multi-root workspaces - escaton
* multiroot workspace statusBar displays both active folder and workspace summary info - connectdotz
* fix race condition in multi-root projects - connectdotz
* add folder status bar support for multi-root projects - connectdotz

* support template-literal-string test names by matching with location info from jest result - connectdotz

* paying down some tech debt, see PR#447 for detail.

* Add disableOptimisticBPs option to debug configuration. Fixes #400 - blikblum

* Adds "Jest: Restart Runner" command - vdh

* replaced deprecated vscode.previewHtml command with webview - qalex

### 2.9.1

* Prevent ANSI escape codes from appearing in test messages - seanpoulter
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@ These are the [activation events](https://code.visualstudio.com/docs/extensionAP

These are the things that will trigger the extension loading. If one of these applies, and you're not seeing the "Jest" in the bottom bar, reference the self-diagnosis below

### use extension in multiroot environment
vscode-jest supports multiroot feature, but if you want to turn it off for some workspace folders check out `jest.disabledWorkspaceFolders` configuration setting.
`jest.disabledWorkspaceFolders` is an array of strings with folder names.

### non-standard environments
vscode-jest supports common jest configuration, such as when jest is in `root/node_modules/.bin/jest`, or for react-native `root/node_modules/react-native-scripts`.

Expand Down
18 changes: 17 additions & 1 deletion __mocks__/vscode.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,32 @@
const languages = {
createDiagnosticCollection: jest.fn(),
registerCodeLensProvider: jest.fn(),
}

const StatusBarAlignment = {}
const StatusBarAlignment = { Left: 1, Right: 2 }

const window = {
createStatusBarItem: jest.fn(() => ({
show: jest.fn(),
tooltip: jest.fn(),
})),
showErrorMessage: jest.fn(),
showWarningMessage: jest.fn(),
createTextEditorDecorationType: jest.fn(),
createOutputChannel: jest.fn(),
showWorkspaceFolderPick: jest.fn(),
onDidChangeActiveTextEditor: jest.fn(),
showInformationMessage: jest.fn(),
}

const workspace = {
getConfiguration: jest.fn(),
workspaceFolders: [],
getWorkspaceFolder: jest.fn(),

onDidChangeConfiguration: jest.fn(),
onDidChangeTextDocument: jest.fn(),
onDidChangeWorkspaceFolders: jest.fn(),
}

const OverviewRulerLane = {
Expand All @@ -33,13 +44,18 @@ const DiagnosticSeverity = { Error: 0, Warning: 1, Information: 2, Hint: 3 }
const debug = {
onDidTerminateDebugSession: jest.fn(),
startDebugging: jest.fn(),
registerDebugConfigurationProvider: jest.fn(),
}

const commands = {
executeCommand: jest.fn(),
registerCommand: jest.fn(),
}

const CodeLens = function CodeLens() {}

export {
CodeLens,
languages,
StatusBarAlignment,
window,
Expand Down
39 changes: 26 additions & 13 deletions integrations/create-react-example/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1336,7 +1336,7 @@ async@^1.5.2:
resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a"
integrity sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=

async@^2.1.4, async@^2.5.0:
async@^2.1.4:
version "2.6.1"
resolved "https://registry.yarnpkg.com/async/-/async-2.6.1.tgz#b245a23ca71930044ec53fa46aa00a3e87c6a610"
integrity sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==
Expand Down Expand Up @@ -2273,6 +2273,11 @@ commander@~2.13.0:
resolved "https://registry.yarnpkg.com/commander/-/commander-2.13.0.tgz#6964bca67685df7c1f1430c584f07d7597885b9c"
integrity sha512-MVuS359B+YzaWqjCL/c+22gfryv+mCBPHAv3zyVI2GN8EY6IRP8VwtasXn8jyyhvvq84R4ImN1OKRtcbIasjYA==

commander@~2.20.0:
version "2.20.0"
resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.0.tgz#d58bb2b5c1ee8f87b0d340027e9e94e222c5a422"
integrity sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==

common-tags@^1.4.0:
version "1.8.0"
resolved "https://registry.yarnpkg.com/common-tags/-/common-tags-1.8.0.tgz#8e3153e542d4a39e9b10554434afaaf98956a937"
Expand Down Expand Up @@ -4107,11 +4112,11 @@ handle-thing@^1.2.5:
integrity sha1-/Xqtcmvxpf0W38KbL3pmAdJxOcQ=

handlebars@^4.0.3:
version "4.0.12"
resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.0.12.tgz#2c15c8a96d46da5e266700518ba8cb8d919d5bc5"
integrity sha512-RhmTekP+FZL+XNhwS1Wf+bTTZpdLougwt5pcgA1tuz6Jcx0fpH/7z0qd71RKnZHBCxIRBHfBOnio4gViPemNzA==
version "4.1.2"
resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.1.2.tgz#b6b37c1ced0306b221e094fc7aca3ec23b131b67"
integrity sha512-nvfrjqvt9xQ8Z/w0ijewdD/vvWDTOweBUm96NTr66Wfvo1mJenBLwcYmPs3TIBP5ruzYGD7Hx/DaM9RmhroGPw==
dependencies:
async "^2.5.0"
neo-async "^2.6.0"
optimist "^0.6.1"
source-map "^0.6.1"
optionalDependencies:
Expand Down Expand Up @@ -5361,9 +5366,9 @@ js-tokens@^3.0.0, js-tokens@^3.0.2:
integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==

js-yaml@^3.12.0, js-yaml@^3.7.0, js-yaml@^3.9.0:
version "3.12.0"
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.12.0.tgz#eaed656ec8344f10f527c6bfa1b6e2244de167d1"
integrity sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A==
version "3.13.1"
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847"
integrity sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==
dependencies:
argparse "^1.0.7"
esprima "^4.0.0"
Expand Down Expand Up @@ -6139,10 +6144,10 @@ negotiator@0.6.1:
resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.1.tgz#2b327184e8992101177b28563fb5e7102acd0ca9"
integrity sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=

neo-async@^2.5.0:
version "2.5.2"
resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.5.2.tgz#489105ce7bc54e709d736b195f82135048c50fcc"
integrity sha512-vdqTKI9GBIYcAEbFAcpKPErKINfPF5zIuz3/niBfq8WUZjpT2tytLlFVrBgWdOtqI4uaA/Rb6No0hux39XXDuw==
neo-async@^2.5.0, neo-async@^2.6.0:
version "2.6.1"
resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.1.tgz#ac27ada66167fa8849a6addd837f6b189ad2081c"
integrity sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw==

nice-try@^1.0.4:
version "1.0.5"
Expand Down Expand Up @@ -9087,14 +9092,22 @@ uglify-es@^3.3.4:
commander "~2.13.0"
source-map "~0.6.1"

uglify-js@3.4.x, uglify-js@^3.1.4:
uglify-js@3.4.x:
version "3.4.9"
resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.4.9.tgz#af02f180c1207d76432e473ed24a28f4a782bae3"
integrity sha512-8CJsbKOtEbnJsTyv6LE6m6ZKniqMiFWmm9sRbopbkGs3gMPPfd3Fh8iIA4Ykv5MgaTbqHr4BaoGLJLZNhsrW1Q==
dependencies:
commander "~2.17.1"
source-map "~0.6.1"

uglify-js@^3.1.4:
version "3.6.0"
resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.6.0.tgz#704681345c53a8b2079fb6cec294b05ead242ff5"
integrity sha512-W+jrUHJr3DXKhrsS7NUVxn3zqMOFn0hL/Ei6v0anCIMoKC93TjcflTagwIHLW7SfMFfiQuktQyFVCFHGUE0+yg==
dependencies:
commander "~2.20.0"
source-map "~0.6.1"

uglifyjs-webpack-plugin@^1.2.4:
version "1.3.0"
resolved "https://registry.yarnpkg.com/uglifyjs-webpack-plugin/-/uglifyjs-webpack-plugin-1.3.0.tgz#75f548160858163a08643e086d5fefe18a5d67de"
Expand Down
8 changes: 8 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
testRegex: "tests/.*\\.ts$",
automock: true,
moduleFileExtensions: ["ts", "js", "json"],
setupFiles: ["./tests/jestSetup.js"],
};
8 changes: 0 additions & 8 deletions jest.json

This file was deleted.

Loading

0 comments on commit 745e603

Please sign in to comment.