Debugging with VS Code
The repository includes a pre-configured VS Code debug configuration that works with nodemon’s--inspect flag.
1
Build the application
If you haven’t already, run the build step before starting:
2
Start the server in debug mode
--inspect flag, which opens the V8 inspector on 127.0.0.1:9229 and prints a message like:3
Open the Debug panel in VS Code
Click the Run and Debug icon in the Activity Bar (or press Ctrl+Shift+D on Windows/Linux, ⇧⌘D on macOS).
4
Select the Node: Nodemon configuration
In the Run and Debug panel, open the configuration dropdown at the top and select Node: Nodemon.Press F5 or click the green Start Debugging button.VS Code will display all running Node processes. Look for the process that was started with the
--inspect flag.5
Attach to the inspected process
Select the node process that shows the
--inspect flag. VS Code will attach the debugger.You can now set breakpoints, step through code, inspect variables, and use the Debug Console.Understanding nodemon restarts
nodemon watches specific file types and directories and restarts the server when it detects changes. Knowing what does and does not trigger a restart saves debugging time. Triggers a restart:- Any
.ts,.json,.yml,.md,.html, or.scssfile inside a watched directory (mainlysrc/) - Changes to
package.jsonor other config files at the root
content/— documentation Markdown filesdata/reusables/,data/variables/,data/glossaries/,data/product-examples/,data/learning-tracks/assets/,script/,tests/,translations/,rest-api-description/,semmle-code/
Key environment variables for development
Set these in your.env file or inline when starting the server.
When
ELASTICSEARCH_URL is not set, search requests are proxied to the production endpoint. Set it only if you’re working on search indexing or query logic.Using the fixture server for testing
The fixture server loads a small, self-contained content tree fromsrc/fixtures/fixtures instead of the full content directory. It is the recommended way to test application behavior in isolation.
content/ tree.
Running the test suite
The project uses Vitest as its test runner. All test commands are available vianpm test.
Running all tests
Running a specific test file or directory
Scoped test commands
Several pre-configured test commands set the right environment variables automatically:npm run test:search and npm run test:languages require a running local Elasticsearch instance at http://localhost:9200. Start one via Docker before running these.