]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
workflow: support debug single jest test file in vscode (#360)
authorwangtao0101 <yuecjn@gmail.com>
Wed, 23 Oct 2019 15:20:06 +0000 (23:20 +0800)
committerEvan You <yyx990803@gmail.com>
Wed, 23 Oct 2019 15:20:05 +0000 (11:20 -0400)
.vscode/launch.json [new file with mode: 0644]
scripts/jest.js [new file with mode: 0644]

diff --git a/.vscode/launch.json b/.vscode/launch.json
new file mode 100644 (file)
index 0000000..c4ffd0f
--- /dev/null
@@ -0,0 +1,25 @@
+{
+  // Use IntelliSense to learn about possible attributes.
+  // Hover to view descriptions of existing attributes.
+  // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
+  "version": "0.2.0",
+  "configurations": [
+    {
+      "name": "Jest",
+      "type": "node",
+      "request": "launch",
+      "program": "${workspaceFolder}/scripts/jest.js",
+      "stopOnEntry": false,
+      "args": ["${fileBasename}", "--runInBand", "--detectOpenHandles"],
+      "cwd": "${workspaceFolder}",
+      "preLaunchTask": null,
+      "runtimeExecutable": null,
+      "runtimeArgs": ["--nolazy"],
+      "env": {
+        "NODE_ENV": "development"
+      },
+      "console": "integratedTerminal",
+      "sourceMaps": true
+    }
+  ]
+}
diff --git a/scripts/jest.js b/scripts/jest.js
new file mode 100644 (file)
index 0000000..676c322
--- /dev/null
@@ -0,0 +1,7 @@
+/**
+ * This file is the entry for debug single test file in vscode
+ *
+ * Not using node_modules/.bin/jest due to cross platform issues, see
+ * https://github.com/microsoft/vscode-recipes/issues/107
+ */
+require('jest').run(process.argv)