/devcontainer-nx-angular-cypress

A reference app on setting up Angular and Cypress in a devcontainer

Primary LanguageTypeScriptMIT LicenseMIT

Devcontainer for Angular and Cypress in Nx Workspace

This is the setup I use on a Windows machine with the latest version of WSL that has WSLg for displaying Linux GUI apps like Electron. The devcontainer installs the necessary Linux packages to make Cypress work and does a Cypress install when the devcontainer is (re)built. You can also optionally install browsers into the devcontainer. See the containerEnv section in devcontainer.json for instructions. I opted to install the browsers directly instead of using one of the Cypress Docker Images so that I don't have to change the command to launch the tests and I don't have to install Docker in the devcontainer. Also, the Cypress factory image doesn't currently install Webkit. I may investigate this later. The forwared ports and vscode extensions are not really important for this but they are the defaults that I use.

I am not sure if this will work in GitHub Codespaces becuase AFAIK an x11 server or desktop-lite is required. See this link for more details on setting that up.