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