Closed jakub-gonet closed 2 weeks ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
react-native-ide | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Jun 12, 2024 2:10pm |
It's possible to run tests without running VSC instance but we'd need to mock vscode imports somehow. I left it for the future as it's good enough in the current shape.
Adds vscode-test package that allows for testing extension.
We configure it's user data directory because it creates a socket and socket's path is used as a key. Unfortunately, it only supports 103 characters so long paths get trimmed and it doesn't clean the socket before next run.
For tests, it uses mocha. We additionally use sinon for creating mocks.
Mocha only supports JS files, we transpile them using TS in the dist directory, under
test/
. We ignore this directory when creating a VSIX package.Tests are structured as follows:
integration-tests
directory for more end-to-end testing.XXX.test.ts
files next to implementation to unit test it.To run tests execute
npm run test
command which rebuilds webview and extension, then running tests. It expects simulator executable in the dist directory, you can regenerate it withnpm run build:sim-server-debug
.Few sources that can be used as a reference for writing tests: