Skip to content

The open alternative to Salesforce, designed for AI.

Add vscode tasks for integration test run and inputs to debug mode (#17327)

Paul Rastoinf10515fc2d1d
diff --git a/.vscode/launch.json b/.vscode/launch.json
index 9ff10b3883a..067baa6516d 100644
--- a/.vscode/launch.json
+++ b/.vscode/launch.json
@@ -68,6 +68,7 @@
"./jest-integration.config.ts",
"${relativeFile}",
"--silent=false",
+ "${input:updateSnapshot}"
],
"cwd": "${workspaceFolder}/packages/twenty-server",
"console": "integratedTerminal",
@@ -98,5 +99,14 @@
"NODE_ENV": "test"
}
}
+ ],
+ "inputs": [
+ {
+ "id": "updateSnapshot",
+ "type": "pickString",
+ "description": "Update snapshots?",
+ "options": ["", "--updateSnapshot"],
+ "default": ""
+ }
]
}
diff --git a/.vscode/tasks.json b/.vscode/tasks.json
index 77dbad6d49f..395a4df0a69 100644
--- a/.vscode/tasks.json
+++ b/.vscode/tasks.json
@@ -2,12 +2,42 @@
"version": "2.0.0",
"tasks": [
{
- "type": "npm",
- "script": "start",
- "path": "server",
- "problemMatcher": [],
- "label": "yarn: start - server",
- "detail": "yarn start"
+ "label": "twenty-server - run integration test file",
+ "type": "shell",
+ "command": "npx nx run twenty-server:jest -- --config ./jest-integration.config.ts ${relativeFile} --silent=false ${input:watchMode} ${input:updateSnapshot}",
+ "options": {
+ "cwd": "${workspaceFolder}/packages/twenty-server",
+ "env": {
+ "NODE_ENV": "test",
+ "NODE_OPTIONS": "--max-old-space-size=12288 --import tsx/esm"
+ },
+ "shell": {
+ "executable": "/bin/zsh",
+ "args": ["-l", "-c"]
+ }
+ },
+ "presentation": {
+ "reveal": "always",
+ "panel": "new",
+ "close": false
+ },
+ "problemMatcher": []
+ }
+ ],
+ "inputs": [
+ {
+ "id": "watchMode",
+ "type": "pickString",
+ "description": "Enable watch mode?",
+ "options": ["", "--watch"],
+ "default": ""
+ },
+ {
+ "id": "updateSnapshot",
+ "type": "pickString",
+ "description": "Update snapshots?",
+ "options": ["", "--updateSnapshot"],
+ "default": ""
}
]
-}
\ No newline at end of file
+}