Platform Independent Local Dev Guide for Typescript development

Hi @ally,

For a Typescript V1 Repo, Live Preview is not currently available locally. Locally, we can easily run unit tests using the command:

./gradlew test

If you modify your jest file like I mention here, code coverage is outputted to the command line and ./functions-typescript/coverage/index.html . This is viewable inside the DevContainer using the ms-vscode.live-server extension.

My co-worker also recently discovered that VS Code/Cursor Test integration is supported out of the box. Here is the addition to my guide:

Testing

Function testing is done using the Jest framework. To run and debug tests locally, install the Jest extension, Orta.vscode-jest, in VS Code or Cursor. This extension works with DevContainers!

Once installed, you will be able to run tests and view coverage from within your IDE.

To test your code with Live Preview, you would have to commit, push your changes, and then open the repo in the web ui

1 Like