Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM mcr.microsoft.com/devcontainers/typescript-node:22-bookworm@sha256:7653612ebf9384fa1cbd32413d8f4fbf7daaf24e39e8664d9fc030de8c0c0af2

# VS Code/Electron share Chromium's native library requirements; playwright
# install-deps tracks that list upstream. xvfb enables headless test runs.
RUN npx --yes playwright install-deps chromium && \
apt-get update && \
apt-get install --yes --no-install-recommends xvfb && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /root/.npm
10 changes: 10 additions & 0 deletions .devcontainer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# vscode-coder devcontainer

[![Open in Dev Containers](https://img.shields.io/static/v1?label=Dev%20Containers&message=Open&color=blue)](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/coder/vscode-coder)

A ready-to-code environment matching CI: Node 22, pnpm, and `xvfb` for
headless integration tests. Click the badge above (or run **Dev
Containers: Clone Repository in Container Volume…** from the command
palette) to spin it up.

See [`AGENTS.md`](../AGENTS.md) for build, lint, and test commands.
18 changes: 18 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "vscode-coder",
"build": {
"dockerfile": "Dockerfile"
},
"remoteUser": "node",
"customizations": {
"vscode": {
"extensions": [
"esbenp.prettier-vscode",
"dbaeumer.vscode-eslint",
"vitest.explorer",
"ms-vscode.extension-test-runner"
]
}
},
"postCreateCommand": "pnpm install --frozen-lockfile"
}
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ updates:
interval: "weekly"
cooldown:
default-days: 7
- package-ecosystem: "docker"
directory: "/.devcontainer"
schedule:
interval: "weekly"
cooldown:
default-days: 7
- package-ecosystem: "npm"
directory: "/"
schedule:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
/.vscode-test/
/.nyc_output/
/coverage/
/.pnpm-store/
*.vsix
pnpm-debug.log
.eslintcache
Expand Down
7 changes: 7 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ doesn't make sense. Honesty over agreeableness.
| **Single extension test** | `pnpm test:extension ./test/unit/filename.test.ts` |
| **Single webview test** | `pnpm test:webview ./test/webview/filename.test.ts` |

Integration tests launch VS Code and need a display. On headless
environments (CI, devcontainers) prefix with `xvfb-run -a`:

```sh
xvfb-run -a pnpm test:integration
```

## Testing

- Test observable behavior and outputs, not implementation details
Expand Down