From 5de215bdd6ed01bb1d613719f2b5f52eb43390f9 Mon Sep 17 00:00:00 2001 From: Bryce Osterhaus Date: Mon, 30 Sep 2024 10:19:15 +0400 Subject: [PATCH] LPD-37078 - Re-add content and link to example json configuration --- modules/_node-scripts/README.markdown | 13 ++++++++++++ modules/_node-scripts/README.txt | 1 - .../example-vscode-debug-config.json | 20 +++++++++++++++++++ 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 modules/_node-scripts/README.markdown delete mode 100644 modules/_node-scripts/README.txt create mode 100644 modules/_node-scripts/example-vscode-debug-config.json diff --git a/modules/_node-scripts/README.markdown b/modules/_node-scripts/README.markdown new file mode 100644 index 00000000000000..4f77e03fe729c5 --- /dev/null +++ b/modules/_node-scripts/README.markdown @@ -0,0 +1,13 @@ +# Liferay `node-scripts` + +This document exists to contain an assortment of knowledge about `node-scripts`. + +## `node-scripts test` + +### Setting up Jest debugging in VS Code [LPD-37078](https://liferay.atlassian.net/browse/LPD-37078) + +Add a launch configuration for Jest in VS Code. Quickly do this by opening command palette and searching for `Debug: Add configuration...`. This will add a local configuration to your vscode workspace and should not be committed to git. + +Then use the [example-vscode-debug-config.json](./example-vscode-debug-config.json) as your configuration. + +Now you can navigate to your test file and run the vscode debugger. \ No newline at end of file diff --git a/modules/_node-scripts/README.txt b/modules/_node-scripts/README.txt deleted file mode 100644 index 6c95c8cca0fb1c..00000000000000 --- a/modules/_node-scripts/README.txt +++ /dev/null @@ -1 +0,0 @@ -See https://liferay.atlassian.net/browse/LPD-37078. \ No newline at end of file diff --git a/modules/_node-scripts/example-vscode-debug-config.json b/modules/_node-scripts/example-vscode-debug-config.json new file mode 100644 index 00000000000000..2407d74453155d --- /dev/null +++ b/modules/_node-scripts/example-vscode-debug-config.json @@ -0,0 +1,20 @@ +{ + "configurations": [ + { + "args": [ + "test", + "${fileBasenameNoExtension}" + ], + "console": "integratedTerminal", + "cwd": "${fileDirname}", + "env": { + "NODE_ENV": "test" + }, + "name": "Liferay node-scripts test: current file", + "request": "launch", + "runtimeExecutable": "yarn", + "type": "node" + } + ], + "version": "0.2.0" +} \ No newline at end of file